ProGUI V3 Alpha 3 Ready for testing!

Developed or developing a new product in PureBasic? Tell the world about it.
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

So this is a visualisation of how I'm currently going to go about colouring each side of the rounded rectangle individually (using the new algorithm).
This example is colouring the top side of the rounded rectangle in red (with the overall shape marked in green).

So the first step is clipping the top side which is the blue polygon path/shape - this ensures that the left, bottom and right sides won't be rendered to.

The second step is clipping to the rounded rectangle path/shape itself (in green) - so all rendering is constrained inside the shape.

The third step is then rendering a red triangle (the top border side colour wich creates the diagnal 'hinges', where the other sides would join), with the apex being calculated from 2 infinite lines intersecting from the topLeft + leftWidth and topRight - rightWidth.

https://www.youtube.com/shorts/d3HCOVpDYso

And here it is with the clipping paths applied:

https://www.youtube.com/shorts/P1qduWbnbH8
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

Finally got the grunt of the rounded rectangle border code working (including edge cases) after 2 weeks and 3 refactors! The maths has been an absolute barstard! (not my strong point lol but I get by). Now only using one clip path - the rounded rectangle path/shape itself (consisting of an outer path and inner path) and the coloured sides are rendered using polygons masked by the clip path.

So in this vid I'm going a bit nuts with the width of each side animating independently and the x and y radius of each corner animating independently using a nice Transition_EaseInSine() from ProGUI's animation API.

https://www.youtube.com/watch?v=SEusV0_EBU8

So this is an example of instead of clipping to the rounded rectangle path/shape I'm rendering it instead so you can see how the coloured side rendering is achieved with polygons (overlaid on top), which is kind of cool to look at heheh

https://www.youtube.com/shorts/yG_sHNl9Q5Q

This is all done using ProGUI's vector path functions :)
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by Zach »

Not sure I'd find a practical use for that example, but it looks pretty cool
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

Zach wrote: Fri Oct 25, 2024 12:33 am Not sure I'd find a practical use for that example, but it looks pretty cool
Haha yep, it's just to demonstrate the versatility of it really and to test many possible combinations easily (more than I could have manually) - to make sure nothing is bugging out. It does look cool though! :lol:

It's been an important bit of code to get right as pretty much all UI elements have some kind of border - I'll be adding angled corners too once I've got the other styles working so you can imagine some funky looking buttons etc..
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

Or some cool LCARS designs if you're a Trekkie ;) .. it might seem like overkill but not when you can totally change the design of a button or menu through editing a skin
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
User avatar
jacdelad
Addict
Addict
Posts: 1991
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by jacdelad »

I already did a LCARS include for personal use. 8)
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

jacdelad wrote: Sat Oct 26, 2024 11:49 pm I already did a LCARS include for personal use. 8)
:D :D
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by Zach »

LCARS would be cool to play with
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

Zach wrote: Sun Oct 27, 2024 1:29 am LCARS would be cool to play with
For sure, just alter the width of a border side or the corner x and y radius for any widget
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

Hey guys, sorry this is taking a while (I'll be glad when I can move on from it) but it's pretty important to get this working right.

So this is testing out the Groove and Ridge code with the bottom side, this is meant to mimic Web CSS equivalents (colours are chosen for contrasting test purposes). It's particularly challenging making sure the joins are seamless without any tiny gaps where the backround colour would seep through especially making sure everything is aligned to the pixel grid for sharp lines and high DPI scaling - in this example the colour/s for the bottom side has an opacity set at 0.5

https://www.youtube.com/shorts/4izoW9DHhRs

Also fixed a couple of bugs where an extreme rx / ry corner radius would cause an arc path over-sweep - causing some nasty graphical glitches
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by idle »

looks like you've nailed it. Nothing like a bit of perseverance to get it right. :D
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

idle wrote: Thu Oct 31, 2024 2:21 am looks like you've nailed it. Nothing like a bit of perseverance to get it right. :D
Thanks mate for sure! I'm a bit of a perfectionist :lol:
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

Hi guys the core border rendering code is working well (fingers crossed):

Styles include:
  • solid
  • inset
  • outset
  • ridge
  • groove
  • double
  • dashed
  • dotted
Are all implemented and feature comparable with Web CSS (with independently coloured sides and styles), I've also added a couple of new commands to the GFX API: DrawSetAntialias(Mode.i) and DrawSetBlendMode(Mode.i).

https://www.youtube.com/shorts/DjlZNR81F5c
https://www.youtube.com/shorts/oj72P2GXX7k

This vid is a side by side comparison with Firefox and Chrome:
https://www.youtube.com/shorts/RPgx2XvPC4U

In Firefox you can see there's some jankiness when the width of the border is too small.
In Chrome there are gaps with the diagnal line joins and anti-aliasing is not working correctly.

The same jankiness can be seen with Groove and Ridge borders on both Firefox and Chrome.

Cheers!

Chris.
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
PrincieD
Addict
Addict
Posts: 858
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by PrincieD »

Over 30,000 lines of code now for the core engine! and over 300 API commands with the DLL compiling to less than an Amiga floppy disk (745KB) with no dependencies. The old version of ProGUI was about 48,000 lines I think with just over 100 API commands and the DLL over 2.4 meg. Also added new commands: BrushSetDpiScaling(Brush, isEnabled.b), BrushGetDpiScaling(Brush), BorderSetDpiScaling(Border, isEnabled.b), BorderGetDpiScaling(Border).

Currently hooking up the new border rendering code to widgets and optimising alpha masking.

Chris.
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: ProGUI V3 Alpha 2.1 Ready for testing!

Post by idle »

Good to hear about the progress and you don't hold back on getting it right!
Post Reply