GUI Improvements and Ideas

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
DrAnonymous
Posts: 34
Joined: Thu Aug 04, 2005 9:37 pm

GUI Improvements and Ideas

Post by DrAnonymous »

Is anyone using the GUI in Irrlicht?

I wanted to modify the system somewhat to support making medium complexity GUIs easier. Some thoughts included -

- Adding methods to support adding buttons and other widgets by size, ie (x, y, width, height)

- Adding very basic layout capability (vertical and horizontal) ie - addButton(myButton, ELAYOUT_VERTICAL) This would let you drop in a row of column of GUI elements quickly.

- Adding the ability to specify a Widget by percent of the parent's size. So you could have a widget, which you create by giving x, y, percentWidth, percentHeight. Then you could do something like make 2 buttons and tell them both to take up 50% of the width of their parent container.

What are peoples thoughts? Any other suggestions?

Regards,
Dr. A>
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

I can see that adding buttons by size and percentage of the parents size might be useful, but isn't it easy enough to do with the existing code? You could just make a wrapper function that has X,Y width and height as parameters, then call the standard add button function using these parameters to form the rect element. Something similar can also be done with your parent size idea.

I gues what i'm saying is that i wouldn't like to see this added to the base GUI api. I feel that would just increase the number of functions in the API without adding any new functionality.

I really don't see how your layout capability would work. Are you trying to say that if for example you where creating a group of vertical buttons it would automatically calulate the y position of the next element based on the postion and size of the last element? If so that sounds pretty cool, but i would think the a GUI editior like GUICE allow for the same thing.
DrAnonymous
Posts: 34
Joined: Thu Aug 04, 2005 9:37 pm

Post by DrAnonymous »

I didn't know about GUICE before, so I'm looking into that. The reason I'm so attracted to IrrLicht is its cross platform, which is very big for what I need.

If you've done any Java programming or .NET, they use a different paradigm for their GUI. I much prefer code that looks something like this (this would be a the IrrLicht idea) -

myTab->addElement(new Button("my text", 100));
myTab->addElement(new Button("my button", 101));
myTab->addElement(new Slider("my text", 102));

The tab would have a layout setting, vertical/horizontal, which would enable automatically calculating the position of each button. The buttons would also have a default size, so you wouldn't have to specify it all the time.

It doesn't make sense to me to have to call a method on the GUIENvironment to add a new button, text box, etc. I think it would be nice to have constructors which don't require the environment being passed in.

My only other gripe is not being able to specify a new button or text box, etc, by using xposition, yposition, width, height. Its easier to look at a function that uses width and height, rather than having to do the subtraction in your head between the start and end points.

I like the system in general. I think its very well done. I am just looking for some convenience functions, when doing lots of GUI work by hand.

Dr. A>
AutoDMC
Posts: 104
Joined: Sat Sep 18, 2004 3:44 pm

Post by AutoDMC »

I've started working on something that allows you to set up a "screen resolution" (640x480), place all your widgets into that space, then the GUI layout editor would scale up and down the actual widget placement to fit the resolution of your render.

Also, I wanted to try to implement a container type GUI layout. For example, you would do something like this:

(psuedocode)

Code: Select all

new Window
Window->setLayout(LAYOUT_HORIZONTAL)
Window->addContainer(verticalButtons)

verticalButtons->setLayout(LAYOUT_VERTICAL)
verticalButtons->addButton(buttonA)
verticalButtons->addButton(buttonB)
verticalButtons->addButton(buttonC)

Window->addContainer(horizontalButtons)

horizontalButtons->setLayout(LAYOUT_VERTICAL)
horizontalButtons->addButton(buttonA)
horizontalButtons->addButton(buttonB)
horizontalButtons->addButton(buttonC)
Which would produce something like this:

Code: Select all

+Window-----------------------------------------------+
|+verticalButtons------+ +horizontalButtons----------+|
||+-------------------+| |                           ||
|||      buttonA      || |                           ||
||+-------------------+| |                           ||
||+-------------------+| |+-------++-------++-------+||
|||      buttonB      || ||buttonA||buttonA||buttonA|||
||+-------------------+| |+-------++-------++-------+||
||+-------------------+| |                           ||
|||      buttonC      || |                           ||
||+-------------------+| |                           ||
|+---------------------+ +---------------------------+|
+-----------------------------------------------------+
'Course, I havn't had any time to do anything fun like that :(! If I'mnot too mistaken, this is how the GUI works for programs like Mozilla Firefox... in fact I might have read it from something like that. Hmm...

Anyway, I bet something powerful like that wouldn't be too useful for a game. But a gui that dynamically scales to the screen resolution would be nice.

I'll work on that, when I get time... :D
DrAnonymous
Posts: 34
Joined: Thu Aug 04, 2005 9:37 pm

Post by DrAnonymous »

Outstanding! Thats exactly the line of thinking I had. I agree that for a game, its probably overkill. My problem is doing data visualization and needing a more complex gui. I don't want to spend alot of time doing gui layout by hand, when I can have a container size things for me.

Being resizeable would be awesome, but I could actually live without it if I had to.

Let me know what other ideas you have. Maybe we can collaborate a bit and come up with something.

Cheers,
Dr. A>
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

I spent 8 months coding guice you're telling me you havent noticed any of the 3-4 versions that were released in that time?

uhh...

yeah you better take a look... besides I'm way ahead of you guys on this subject just wait till you see some of the newest features 8)
DrAnonymous
Posts: 34
Joined: Thu Aug 04, 2005 9:37 pm

Post by DrAnonymous »

I did check out GUICE. It was quite nice. The biggest problem was that it isn't cross platform. :( Thats one of the biggest attractions of IrrLicht. I need a tool set that runs where IrrLicht runs.

Will you be adding support for tab controls and windows?

Having your editor and some more layout features in the code would both be good, IMHO.

Cheers,
Dr. A>
Bazzilic
Posts: 21
Joined: Mon Jun 20, 2005 6:44 pm
Location: Moscow, Russia

Post by Bazzilic »

I wanna suggest to add to GUI a FileSaveDialog, like the FileOpenDialog... It may be very useful.
Sincerely yours, Bazzilic
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

@Midnight: Oooh oooh! Snap to grid is a must! I sure hope you make that, I've been using your editor, great work!
________
Free Gift Card
Last edited by disanti on Thu Feb 24, 2011 10:38 am, edited 1 time in total.
TheRLG
Posts: 372
Joined: Thu Oct 07, 2004 11:20 pm

Post by TheRLG »

Yeah when I was working on a little project for a maze editor using Guice code, got snap-to-grid to work fairly quickly so I dont see why he would'nt have it :P

@AutoDMC, yeah thats pretty much how the GUI works in XUL applications (which is how firefox works) thats why i wish there was a way to use Gecko & XUL & javascript and etc... in Irrlicht.
Post Reply