May 21, 2019, 10:48:54 PM

Author Topic: Qube's Game Framework - The dreaded GUI  (Read 700 times)

Offline blinkok

  • Jr. Member
  • **
  • Posts: 92
Re: Qube's Game Framework - The dreaded GUI
« Reply #30 on: May 16, 2019, 01:25:29 AM »
Super awesome. Really looks neat. Do you do that with the scissor command or render to a canvas?

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 1822
Re: Qube's Game Framework - The dreaded GUI
« Reply #31 on: May 16, 2019, 02:03:25 AM »
Super awesome. Really looks neat. Do you do that with the scissor command or render to a canvas?
Thanks :) - It's with the scissor command which is a pain as the container also needs a scissor command to allow for window dimensions that are larger than the container and you can't have a scissor within a scissor so it took a little faff about to work smoothly.

Writing a GUI really needs some form of OOP but AGK doesn't have OOP. When I set about this I didn't want to have any part of the GUI in a DIM or have any limits on the amount of windows or gadgets. So what was the solution?. AGK does have Types which in a way can act like a sudo OOP for referencing, so I can have things like window.xpos window.ypos etc etc. Granted types only return things like integers, floats or string etc, but it offers enough to allow you to create a dynamic system with no hard limits or crazy DIM usage.

Insert a few lookup routines and you have a close enough OOP system to create a fully dynamic no limits GUI system ;D
Until the next time...

Offline blinkok

  • Jr. Member
  • **
  • Posts: 92
Re: Qube's Game Framework - The dreaded GUI
« Reply #32 on: May 16, 2019, 03:16:45 AM »
I was thinking of using separate apps for each window and using comms to pass the data. That way no worrying about windows as such and the panels could be dragged onto another screen

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 1822
Re: Qube's Game Framework - The dreaded GUI
« Reply #33 on: May 16, 2019, 03:25:10 AM »
I was thinking of using separate apps for each window and using comms to pass the data. That way no worrying about windows as such and the panels could be dragged onto another screen
That sounds like an odd complex idea. What's your thinking behind it rather than in-app where each and every data is easily accessible?
Until the next time...

Offline blinkok

  • Jr. Member
  • **
  • Posts: 92
Re: Qube's Game Framework - The dreaded GUI
« Reply #34 on: May 16, 2019, 04:56:58 AM »
Mostly for the ability to drag the windows outside the primary window. If you look at any IDE now days they have that functionality (which is great for multiple screens). It also separates out most of the processing from the main app. So all you are doing is passing data from one app to another which would be super easy with json strings. The window would have a very low FPS so as not to drag on the CPU and less chance of conflict with data names within the main app

Online Derron

  • Hero Member
  • *****
  • Posts: 2083
Re: Qube's Game Framework - The dreaded GUI
« Reply #35 on: May 16, 2019, 06:28:20 AM »
You could just use the widget system of your desktop. This is like an ingame gui.

Bye
Ron

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 1822
Re: Qube's Game Framework - The dreaded GUI
« Reply #36 on: May 17, 2019, 02:27:45 AM »
Tonights work was adding interaction between windows and GUI gadgets. This is super easy to code in a fixed environment but not so much when it comes to a more dynamic GUI. The below video is boring but at the same time shows a working interaction that can be applied to any amount of windows.

Until the next time...

Offline blinkok

  • Jr. Member
  • **
  • Posts: 92
Re: Qube's Game Framework - The dreaded GUI
« Reply #37 on: May 17, 2019, 05:24:13 AM »
It looks very very smooth. very nice work

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 1822
Re: Qube's Game Framework - The dreaded GUI
« Reply #38 on: May 20, 2019, 03:48:55 AM »
It's that exciting time again ;D

Moved on to GUI code creation \o/ - This video shows creating a basic window, editing the gadgets and the outputted code with event handlers. Not all events will be needed so I'll just delete the ones I don't want.

Creating a GUI designer was a lot more work than I first thought. I've never done one before but it's going to be a great time saver when it comes to whipping up GUI bits for the upcoming tools adventure.

Here's the video ( ooops, spelling mistakes included )

Until the next time...

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1063
Re: Qube's Game Framework - The dreaded GUI
« Reply #39 on: May 20, 2019, 06:31:28 AM »
text:align - you deserve a medal :) none of that Taxt:gravity rubbish!

Online Derron

  • Hero Member
  • *****
  • Posts: 2083
Re: Qube's Game Framework - The dreaded GUI
« Reply #40 on: May 20, 2019, 07:29:50 AM »
In my bitmapfont-class I have a "DrawBlock" function too - and you can align text with simple "0-1.0" values with "0.5" meaning "center". That way you could even do something like "bouncing texts" within a given boundary.
"left, center, right" are then just constant values.
"ALIGN_TOP_LEFT" is then a vector (0, 0)
"ALIGN_CENTER_LEFT" is then a vector (0, 0.5)
...

This is needed as you most probably WILL land in the situation in which you need to align multi-line-labels to some widgets - and this is not always "top left".

Sometimes it would even be needed to access "font baseline" (so not the bottom of "Qg" in "Quaagg" but the bottom of the letters "uaa"). But this is advanced stuff which could be added when really needed.



@ gui designer
Yes it is heavy stuff. Writing GUI/editor code is what I find most time consuming too. Which is why we have no DB-Editor for TVTower yet, it is just too complex what you need to pack into the editor - all the interaction code (events), editor effects (add an entry needs to update lists and other elements). I kind of dislike it ;-)



bye
Ron

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 1822
Re: Qube's Game Framework - The dreaded GUI
« Reply #41 on: May 20, 2019, 01:26:29 PM »
text:align - you deserve a medal :) none of that Taxt:gravity rubbish!
You made it that far into the video, congrats ;D

Quote
Sometimes it would even be needed to access "font baseline" (so not the bottom of "Qg" in "Quaagg" but the bottom of the letters "uaa"). But this is advanced stuff which could be added when really needed.
The text function I wrote for this handles font kerning too ( as can be seen at the end of the video when it shows the generated source code ). I could of cheated and used the built in text commands but they don't allow for bitmap fonts which are kinda key for games.

Quote
@ gui designer
Yes it is heavy stuff. Writing GUI/editor code is what I find most time consuming too.
It turned out to be a lot more work than I first thought and a lot harder to write a flexible GUI but as I'll be writing many game based tools it'll be a big time saver in the end. Oddly enough the source code generation side turned out to be a piece of cake and I thought that would be the hard part.

Lots to do yet but at least it's finally taking shape. Just have to power through till all the gadgets are coded up and then off I go ;D
Until the next time...