Gui3D : a GUI based on Gorilla

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

Video added in my first post (showing the effect mkultra333 described before)

Gui3D is getting updated :
- Add PanelColors initialization to avoid random values for border and text size (unitialized value).
- Add a possible sprite at the position of the cursor on each panel (see the video added on april the 28th 2012 in my first post).
- Added effect (sprite and gradient+color) for a click on a button (the user now get feedback that he clicked on a button)
- The ScrollBar is now able to call the callback when the value is updating (not only when value is confirmed by a mouseReleased)
- Added a directive in the project that copy necessary files (header + lib) into the sdk/ folder of the project (instead of doing it manually)

I will post the source code of the video i have added too, as an example #2.

I'll post those changes soon, and I will create a github repository for you to follow the project (Gui3D library + examples).
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

Hi !

Gui3D is now on version 1.01 Beta.
I've created a github repository for the project that will now only be hosted by github, on the following link : http://github.com/Valentin33/Gui3D/.
The wiki still available for documentation and ressources.
As GUI3D is still a Beta version, I've made some little changes in the API that can make some error in your code (which are only some new parameters for setBackgroundImages methods (added sprite for a clicked button)). See the CHANGELOG for more informations.
I've added 3 examples too, which are : The Environment demo, the Simple demo and a complete GUI implementation (see the video on the first page).
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Re: Gui3D : a GUI based on Gorilla

Post by DanielSefton »

Thanks for the library, I will probably make use of it in my project :)

At the moment it depends on OIS - it would be nice if it accepted generic values, such as what MyGUI does:

Code: Select all

myGUI->injectMouseMove(myMouseState.x.abs, myMouseState.y.abs, myMouseState.z.abs);
myGUI->injectMousePress(myMouseState.x.abs, myMouseState.y.abs, myButton);
myGUI->injectMouseRelease(myMouseState.x.abs, myMouseState.y.abs, myButton);
myGUI->injectKeyPress(myButton, myText);
myGUI->injectKeyRelease(myButton);
That will make it possible to accept native input on mobile for example. I'll hack in my own input system for now.

Cheers.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: Gui3D : a GUI based on Gorilla

Post by mkultra333 »

That new gui effect is great, thanks for adding it. I know it can be annoying when people focus on what you're project doesn't do instead of what it does, so it's impressive to see the new function added so quickly. Looks ideal now for use as part of the environment inside a first person shooter.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
thebluefish
Gremlin
Posts: 170
Joined: Tue Apr 05, 2011 1:55 am
x 10

Re: Gui3D : a GUI based on Gorilla

Post by thebluefish »

I've already added this into my project, completely took CEGUI out of the question now :) I didn't really like tacking a flat, boring 2D GUI onto the screen, and I absolutely hate working with RTT in CEGUI (just feels way to hack-ish to work with). This, on top of what it was built upon, turned to be exactly what I was looking for in my cartoon-style game. You'll see what I pulled off in the past few days when I finally get a small demo going >:]
During the code inspection, a couple of minor points were noticed: -

Function inlining was critical to performance.
For MSVC, at least, a "delete 0" caused execution of 11 assembly instructions, including a function call. So in cases where performance is at an absolute premium it can be worth inserting the extra manual test.
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

I forget to told you that a small issue remains in Gui3D. It's about the Button. If you click a button, move the cursor out of the panel that contains it and release the click outside the panel, the button keep the clicked state. I'll post a fix soon.
DanielSefton wrote:Thanks for the library, I will probably make use of it in my project :)

At the moment it depends on OIS - it would be nice if it accepted generic values, such as what MyGUI does:

Code: Select all

myGUI->injectMouseMove(myMouseState.x.abs, myMouseState.y.abs, myMouseState.z.abs);
myGUI->injectMousePress(myMouseState.x.abs, myMouseState.y.abs, myButton);
myGUI->injectMouseRelease(myMouseState.x.abs, myMouseState.y.abs, myButton);
myGUI->injectKeyPress(myButton, myText);
myGUI->injectKeyRelease(myButton);
That will make it possible to accept native input on mobile for example. I'll hack in my own input system for now.

Cheers.
That's a good idea, but not sure I'll release anything about that until I really need it.
mkultra333 wrote:That new gui effect is great, thanks for adding it. I know it can be annoying when people focus on what you're project doesn't do instead of what it does, so it's impressive to see the new function added so quickly. Looks ideal now for use as part of the environment inside a first person shooter.
You're welcome ! Any ideas are welcome to improve the project :)
thebluefish wrote:I've already added this into my project, completely took CEGUI out of the question now :) I didn't really like tacking a flat, boring 2D GUI onto the screen, and I absolutely hate working with RTT in CEGUI (just feels way to hack-ish to work with). This, on top of what it was built upon, turned to be exactly what I was looking for in my cartoon-style game. You'll see what I pulled off in the past few days when I finally get a small demo going >:]
Was the same for me, now that Gui3D looks stable and is close of what I need (excepted the PanelColors that would be better if use something like an xml file and still missing a visual editor), I have to replace CEGUI by Gui3D in my own game.
When you got a small demo of your game, you're welcome to post video/screenshots of it on this thread and on the screenshot part of the Gui3D wiki :)
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Re: Gui3D : a GUI based on Gorilla

Post by DanielSefton »

While implementing the "Gui3DScreenPanel" you talked about, I sort of hit a dilema with the positioning. The screen renderable panel is fine because you move it with a scene node. There's not actually any way to move a group of elements with the standard Screen, only individually. Or even if you could, I think it's better to have one global screen for performance reasons. Surely it would have made sense for Gorilla to allow you to position the layers or something?
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

DanielSefton wrote:While implementing the "Gui3DScreenPanel" you talked about, I sort of hit a dilema with the positioning. The screen renderable panel is fine because you move it with a scene node. There's not actually any way to move a group of elements with the standard Screen, only individually. Or even if you could, I think it's better to have one global screen for performance reasons. Surely it would have made sense for Gorilla to allow you to position the layers or something?
Yep I understand. As I haven't play that much with the Screen object, I'm not sure my folowing solution would be that good. Anyway, I'm thinking about :
- As you said, create only one global screen that will be used by every "Gui3DScreenPanel"
- The "Gui3DScreenPanel" would just be a container that allow you to move elements together (by calling the setPosition of each Gui3D PanelElements), or use all function of a Layer (show, hide etc...).

As I have some time, if you want to share anything with me to release the "Gui3DScreenPanel", then we can work together, send me a PM.
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
caseybasichis
Greenskin
Posts: 100
Joined: Wed Jan 25, 2012 7:50 pm
x 1

Re: Gui3D : a GUI based on Gorilla

Post by caseybasichis »

I thought I'd take up the offer to ask a few Gui3D questions here.

My target is iOS. Has the issue with allowing generic input been fixed and if not are there plans to? What about more than one input (touch) for building custom widgets?

Is there any sort of limit to the formatting of the panels/GUI? All the examples feature very sparse layouts. Is there anything prohibiting a much denser packing of element right up to the edges?

How difficult is the process of adding new UI widgets? I am not working on a game, but a great deal of custom UI components are going to be needed. Is there some method to inherit a basic object to build new kidns of widgets?

I have been holding off of hands on development till the fancy pants mac arrives in the mail, but I am really looking forward to digging into this library as it seems like the most interesting of the available options.
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

My target is iOS. Has the issue with allowing generic input been fixed and if not are there plans to? What about more than one input (touch) for building custom widgets?
The idea still in my mind, but as I had my exams + internship for this summer, I have still no time to work on it.
Is there any sort of limit to the formatting of the panels/GUI? All the examples feature very sparse layouts. Is there anything prohibiting a much denser packing of element right up to the edges?
As Gui3D is just a library that is build on top of Gorilla to provide most of the basics elements of an UI (basically, each elements of Gui3D are just a group of Gorilla elements that can move a certain way), you better asking on the Gorilla thread that question.
How difficult is the process of adding new UI widgets? I am not working on a game, but a great deal of custom UI components are going to be needed. Is there some method to inherit a basic object to build new kidns of widgets?
If you want to add new widgets, there's no problems about that.
If you look at the documentation (check the wiki), you'll see that each Gui3DWidget inherits from the Gui3DPanelElement (http://www.valentinfrechaud.fr/GuiWiki/ ... ement.html). Some methods have, of course, to be overided. You can check the code of some basic elements (as Gui3D::Caption or Gui3D::Button) and see how there are made. If you want more complex examples, check the Gui3D::Combobox for example)

As the only examples of using Gui3D are just my examples, I'd love to see how you're using Gui3D in your project :)
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
Options
Gnoblar
Posts: 1
Joined: Thu Dec 27, 2012 11:59 am

Re: Gui3D : a GUI based on Gorilla

Post by Options »

How would one use this as a 2d GUI?
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

Options wrote:How would one use this as a 2d GUI?
With the actual version of the library you can't. You should check on this thread the post where I explain how to do that (ie : http://www.ogre3d.org/forums/viewtopic. ... 34#p456786). DanielSefton made a patch for Gui3D to display PanelElements in 2D (http://www.ogre3d.org/forums/viewtopic. ... 25#p457387). He sent me his patch, that I attached to my post. As I still have no time yet, I couldn't try it, neither made an example application with. When I'll have some time, I'll merge the patch with the Gui3D repository.
Attachments
Gui3D patch DanielSefton.zip
patch 2D Gui3D
(8.84 KiB) Downloaded 107 times
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

Hi,
I have updated Gui3D to support 2D widgets (see the ScreenPanel object that works exactly like the Panel object, except the injectMouseMoved method). Moreover, with this 1.1 version, when you create a Panel, units have changed, and two methods have appears for Panel and ScreenPanel.
Exemple :

Code: Select all

// before :
new Gui3D::Panel(mGui3D, mSceneMgr, Ogre::Vector2(4, 4), "purple", "test_panel");
// now :
new Gui3D::Panel(mGui3D, mSceneMgr, Ogre::Vector2(400, 400), "purple", "test_panel");
This size is consistent with the widgets sizes.

I have updated the repository so you can access it.
Any feedbacks about bugs are appreciated.
Here is a video of 2D panels / widgets. This example can be found in the example/ folder of the repo.

[youtube]bMTj57gSDas[/youtube]
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
caseybasichis
Greenskin
Posts: 100
Joined: Wed Jan 25, 2012 7:50 pm
x 1

Re: Gui3D : a GUI based on Gorilla

Post by caseybasichis »

This is very exciting. Thank you for making this update.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10
Contact:

Re: Gui3D : a GUI based on Gorilla

Post by DanielSefton »

Thanks for the update :) I was wondering if you made it possible to move the 2D dialogs around at runtime with child elements, or if all the 2D elements are still only globally positioned.

Also, you should add a new method called destroyLayerScreen() and use that in ScreenPanel's destructor instead. My bad.
Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 226
Joined: Thu Oct 14, 2010 12:30 pm
x 56

Re: Gui3D : a GUI based on Gorilla

Post by Hotshot5000 »

Does Gui3D or the underlying Gorilla have a way to deal with the following situation:

I am on a mobile phone screen with a wall of text and an OK button(the mission briefing). Since different phones have different screen sizes and I'd like to keep my text size the same, is it able to insert line breaks where it should?

For example:

This is the best game ever. You
will now enter a great world of
conflict.

to a smaller screen:

This is the
best game
ever. You
will now
enter a
great
world
of
conflict.

???
caseybasichis
Greenskin
Posts: 100
Joined: Wed Jan 25, 2012 7:50 pm
x 1

Re: Gui3D : a GUI based on Gorilla

Post by caseybasichis »

Hi,

Is there anyway to have the 3D and 2D render at different resolution's?

I am hoping to display text at retina resolution on top of a lower resolution 3d space.

Can the two run at different frame rates?
mistigrii33
Kobold
Posts: 37
Joined: Fri Oct 07, 2011 8:42 am
Location: Bordeaux, France
x 7

Re: Gui3D : a GUI based on Gorilla

Post by mistigrii33 »

Hi ! I've updated Gui3D to version 1.11 beta. Here is the CHANGELOG :

==== CHANGELOG Gui3D v1.11 beta ====

Gui3D object : The PanelColor passed as parameter isn't deleted anymore. The user has to do it on is own. (which is more logical...)

ScreenPanel : Added a method to move a screenPanel and its childs (setPosition).
ScreenPanel doesn't destroy anymore the screen object passed to the constructor but the layer it creates.

Project : Indentation has changed from tabs to spaces.

=====

I've also updated the examples.
Thanks to report any bugs with it !
DanielSefton wrote:Thanks for the update :) I was wondering if you made it possible to move the 2D dialogs around at runtime with child elements, or if all the 2D elements are still only globally positioned.

Also, you should add a new method called destroyLayerScreen() and use that in ScreenPanel's destructor instead. My bad.
You're welcome ! I made possible to move an entire ScreenPanel with its childs, but you shouldnt do it too often because it's about moving all child one by one !
For the destroyLayerScreen method I prefered the Screen::destroy method, which is I think more appropriated. Anyway, thanks for the advice and ex-bug that destroyed the screen and not the Layer !
Hotshot5000 wrote:Does Gui3D or the underlying Gorilla have a way to deal with the following situation:

I am on a mobile phone screen with a wall of text and an OK button(the mission briefing). Since different phones have different screen sizes and I'd like to keep my text size the same, is it able to insert line breaks where it should?

For example:

This is the best game ever. You
will now enter a great world of
conflict.

to a smaller screen:

This is the
best game
ever. You
will now
enter a
great
world
of
conflict.

???
Sorry, this option isn't implemented so you have to handle it manually, which can be really painfull... :(
As Gui3D is just an overlay on top of Gorilla and it uses Gorilla for all the widgets and text, you should ask this on the Gorilla thread.
caseybasichis wrote:Hi,

Is there anyway to have the 3D and 2D render at different resolution's?

I am hoping to display text at retina resolution on top of a lower resolution 3d space.

Can the two run at different frame rates?
Of course you can do this. The idea is to have 2 Gui3D object that each handle a different atlas. Check the atlas section of the wiki to have more details of how to do this (http://www.valentinfrechaud.fr/GuiWiki/index.php/Atlas)

Hope this helps ! :)
Looking for 2D in 3D environment menus ? try Gui3D : a GUI based on Gorilla !
issmee
Gnoblar
Posts: 1
Joined: Fri May 10, 2013 10:17 am

Re: Gui3D : a GUI based on Gorilla

Post by issmee »

nice work!!

I use it in my project.

but , how does it support asia font? just like chinese or japanese.

in source code or wiki ,I do not get helpfull information

thanks!!
User avatar
Argosse
Gnoblar
Posts: 17
Joined: Wed Apr 27, 2011 9:43 pm

Re: Gui3D : a GUI based on Gorilla

Post by Argosse »

Has anyone used this for android yet? Ive got Gui3D compiled into a static library and can get the 3d panels to show up but cannot get any 2d panels to show up.

Code: Select all

mGui = new Gui3D::Gui3D(&mSimpleDemoColors);
	myScreen = mGui->createScreen(mViewport,"MyGui","mainScreen");
	LOGD("mGui createScreen finished. Starting createBasePanel");

	//createBasePanel(); creates a 3d panel that shows up just fine.
	
	// 2D Panel (using Gorilla::Screen)
	Gorilla::Screen* myScreen = mGui->getScreen("mainScreen");

	Gui3D::ScreenPanel* m2dPanel = new Gui3D::ScreenPanel(mGui,
	            myScreen,
	            Ogre::Vector2(450, 350),
	            Ogre::Vector2(300, 200),
	            "MyGui",
	            "test_screenPanel");
	m2dPanel->makeTextZone(10, 150, 280, 30, "THIS IS A TEXTZONE!!!!!!!");
Post Reply