Author Topic: UI Builder  (Read 2703 times)

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2350
  • OPHD Lead Developer
    • LairWorks Entertainment
UI Builder
« on: September 30, 2016, 01:41:21 AM »
Found that building the UI's in code is very, very tedious so I opted to develop a simple UI Builder type of program. After about an hour of coding this is what I've got so far. Doesn't look like much but you can reposition and resize the Window. Subsequent versions will include a basic properties panel where the user can change the window size and title and add new control's to the window.

Ultimate goal is to have this output to XML files as a basic save/load type deal and when ready 'compile' the XML into C++ source that I can simply plug into OutpostHD's code base and add the game specific logic to the UI panels.

I'm not expecting this tool to be anything spectacularly awesome, don't want to spend too much time on it, but it should be functional enough to ease development of the rest of the UI panels needed for the game which I've been putting off because of how painful it is to do it from scratch by hand.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4954
Re: UI Builder
« Reply #1 on: October 02, 2016, 01:48:54 PM »
Interesting idea. It sounds a bit like Glade.

My preference is to not do any sizing manually, either through code, or in a graphical editor. I prefer using layout managers that fit things according to some set of rules. Makes for supporting different screen sizes easier. I noticed Glade had a section on "size negotiation", which probably relates to what I'm thinking of.




Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2350
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: UI Builder
« Reply #2 on: October 02, 2016, 02:08:37 PM »
Quote
I prefer using layout managers that fit things according to some set of rules.

Agreed though that would apply to full screen GUI's. In OutpostHD's case it's mostly just a couple of windows. The resource HUD and bottom layout are based on screen resolution and adjust themselves accordingly.

When I saw how many UI panels I would need to build/design it occurred to me that it was time to make a tool to make this easier. I would leave it as XML layouts but setting up event hooks is somewhat more difficult that way so I'm sticking with XML's as a saved layout that can then be quickly translated to a C++ source file. That's the general idea at least.