BetaGUI : BetaGUI 2.5 update - Style system added.

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!
funguine
Gnoblar
Posts: 10
Joined: Mon Jan 15, 2007 5:28 pm
Location: Oulu, Finland
x 1

WIP: MogreBetaGUI

Post by funguine »

I found BetaGUI today and liked the direct approach, but as it happens, I'm
currently developing with Mogre. So here's a WIP at getting BetaGUI to work with Mogre. It compiles fine in my
project, but I haven't tested it; and the callback-system is not properly
implemented. Anybody with ideas, or better yet, a finished implementation
for tomorrow when I get back to work .... ;-)

Edit: mind you, this is based on v015 from the wiki, and good part
of the time was spent un-obfuscating the code .... i've since found out
about betajaen's own dev version at http://get.nxogre.org/betagui/.
You'd think one learns from banging the head against the wall?
Well, I'm so angry at myself for not following up on the thread
that I'm still gonna finish *this* version first and patch it to latest
after :D

Edit: it's functional now, the link has been updated.
Last edited by funguine on Tue Aug 28, 2007 1:00 am, edited 1 time in total.
amroc
Bronze Sponsor
Bronze Sponsor
Posts: 15
Joined: Tue May 08, 2007 8:05 pm

Post by amroc »

Haha love the source :)
User avatar
Rhaythe
Halfling
Posts: 61
Joined: Tue Apr 19, 2005 2:25 pm

Post by Rhaythe »

Tried using BetaGUI today, and had it integrated into my application in literally only two minutes.

Many thanks for this fine package! :)
"Perhaps the most fundamental problem, however, is that INTJs really want people to make sense."
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

Wait until you get the new one with the positioning system.

I'm also playing with the idea of working with Cairo again, and creating a some sort of callback system inspired by Cocoa; Usual callbacks to functions, but callbacks to other widgets with "DataPayloads", i.e. up/down buttons next to a text input widget with a floating point number. Pretty much what talked about in the recent thread of GUIs. Seriously powerful, but seriously small. Except I can't think of a good enough name except for BetaGUI 4.

ETA 2012.
nim
Gnoblar
Posts: 22
Joined: Wed Sep 13, 2006 6:22 am
Location: Sweden

Post by nim »

just so I'm sure. the files in http://get.nxogre.org/betagui/ are the latest right? so they're called both "016" and some "2.5" or "3"? or are 2-4 still unreleased? (sorry if it's on previous pages, i have a bad short term memory :))
great work, betajean! appreciate the src over library approach.
lXciD
Greenskin
Posts: 102
Joined: Mon Jul 31, 2006 7:56 pm
Location: Singapore

Post by lXciD »

Hi,

I'm also interested in how beta gui is coming along. Where can I get the latest version?

I downloaded cake which seems like it is using BetaGUI-Bullet.h. Can I know which one should I use? I interested in integrating BetaGUI into my engine. I already is using NxOgre. I love it. Thanks! I am a noob. But i always have a heart to contribute something someday. Hopefully one day, that day will come.

cheers!
User avatar
andreu_as
Gnoblar
Posts: 13
Joined: Mon Dec 03, 2007 12:25 pm
Location: Catalonia, SPAIN

Andrew

Post by andreu_as »

Hi! I can't use BetaGUI in my app because the 1.4.x Ogre version don't found this files ("OgreEventListeners.h", "OgreKeyEvent.h"), I speak spanish (and my english is really bad) someone can help me telling me what I have to do?

Si puede ser en español ya seria la monda! jeje
User avatar
ScottLanning
Gnoblar
Posts: 4
Joined: Sun Aug 19, 2007 5:51 pm

Perl BetaGUI

Post by ScottLanning »

I ported BetaGUI version 016 to Perl:
http://search.cpan.org/dist/Ogre-BetaGUI/

As an example, I ported Intermediate Tutorial 2
(the one where you place robots on a terrain with a CEGUI mouse cursor,
http://www.ogre3d.org/wiki/index.php/In ... Tutorial_2):
http://search.cpan.org/src/SLANNING/Ogr ... /itute2.pl

You should probably also know there are some (incomplete)
Perl bindings for OGRE:
http://search.cpan.org/dist/Ogre/
Last edited by ScottLanning on Tue Dec 04, 2007 11:32 am, edited 1 time in total.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

Wow. The third language for BetaGUI to be ported too, and Perl of all languages. I didn't even know there was a Perl binding for Ogre.

Kudos!

[Edit]

Your more than welcome to add your links and what not to the BetaGUI wiki page, just after the C# version. ;)
User avatar
ScottLanning
Gnoblar
Posts: 4
Joined: Sun Aug 19, 2007 5:51 pm

Post by ScottLanning »

User avatar
andreu_as
Gnoblar
Posts: 13
Joined: Mon Dec 03, 2007 12:25 pm
Location: Catalonia, SPAIN

Post by andreu_as »

This is my small contribution!!!

In the uncompressed betaGUI 016 (I think) I added this function between LINE1 and LINE2:
--------------------------------------------------------------------------------------
/* LINE1 */ void setFontSize(uint fontSize) { mFontSize = fontSize; }
/* MY LINE */ void setFont(String font) { mFont = font; }
/* LINE2 */ OverlayContainer* createOverlay(Ogre::String name, Vector2 position, Vector2 dimensions, Ogre::String material = "", Ogre::String caption = "", bool autoAdd = true);
--------------------------------------------------------------------------------------
for add '->setFont("otherFont")' to the GUI system like the '-setFontSize(16)'

may be it's stupid but I'm noob and happy :D thanks lads!

Sorry for my bad english :oops:
User avatar
andreu_as
Gnoblar
Posts: 13
Joined: Mon Dec 03, 2007 12:25 pm
Location: Catalonia, SPAIN

Post by andreu_as »

Please, I have a question:

In my app I want to erase some items of my GUI (staitcText or buttons) and put others like a refresh action. I tried to do this:

Code: Select all

mGUI->destroyWindow(mWindow); 
but the window don't disappear, then i tried to delete my GUI and create a new one:

Code: Select all

delete mGUI; // that works, the entire GUI disappear! 
mGUI = new BetaGUI::GUI("MyFont",16); // but that crash my App 
This is the crash :
OGRE EXCEPTION(4:ItemIdentityException): Overlay with name 'BetaGUI' already exists! ... blah blah

I tried to do next too:

Code: Select all

delete mWindow; // that works too, but after destroy and create  11 windows crash again with a similar Error
This is the similar crash:
OGRE EXCEPTION(4:ItemIdentityException): OverlayElement with name BetaGUI.w11 already exists. in OverlayManager::createOverlayElement at... blah blah

may be is a problem with the "destructor" I need some help please! Thanks!
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39

Re: WIP: MogreBetaGUI

Post by Beauty »

I wanted to use the usage example code of MogreBetaGUI, but there seems to be still a little problem.

Code: Select all

Callback cc = new Callback(this);  
    // remember to give your program the BetaGUIListener interface
This line makes trouble, because the constructor of BetaGUI.Callback has no argument.
I could'n found an other example for Mogre.
C++ I don't know, only C# (and Perl). Maybe someone can fix it in the forum?

Greetings from Germany
Beauty

http://www.ogre3d.org/wiki/index.php/MogreBetaGUI
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39

Post by Beauty »

I tried to get run the Mogre-Version of BetaGUI.

The problem of my last post seems to be fixed by

Code: Select all

Callback cc = new Callback((BetaGUIListener)this);
// Callback cc = new Callback(this);  // old
Then there are used variables / structs which are not defined in the public code.

Now I modified, can compile, can see the GUI, but no action is possible.
This lines does confuse me:

Code: Select all

uint screenx = (uint)(viewport.ActualWidth * ((float)mouseStatus.X / 50f));
uint screeny = (uint)(viewport.ActualHeight * ((float)mouseStatus.Y / 50f));
This generates large xy-values (like x:7790 y:4380). What is the reason?
Or is it wrong code?

update:
like this it runs:

Code: Select all

uint screenx = (uint)mouseStatus.X;
uint screeny = (uint)mouseStatus.Y;
There are still little other problems, but I will work on.


Does somebody get run a Mogre-Version of BetaGUI?
I would be happy about help (like example code or program).
Also I want to add / update information to the wiki.



General question about the C++ version number:

In the wiki is the Code of version 015 (C++) and on the developer-website is the version 016.
Is there a reason, why it's not updated? What are the differences? I did not found information about in this thread.
Also:
The title of this forum thread is BetaGUI 2.5 [...].
And in the wiki top right box is written Latest Version 1.0'15
This is confusing. What is right?
funguine
Gnoblar
Posts: 10
Joined: Mon Jan 15, 2007 5:28 pm
Location: Oulu, Finland
x 1

mogrebetagui issues still?

Post by funguine »

Beauty wrote:
Does somebody get run a Mogre-Version of BetaGUI?
I would be happy about help (like example code or program).
Also I want to add / update information to the wiki.
Nice work with he Wiki, did you get it running in the end?

--
ketarax/funguine
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39

Post by Beauty »

I got it to run, but I was not happy with it.

In the wiki I added information about the problems in the section "how to use", but (as I saw just now) somebody did remove my notes.
This would be ok, when the problems are fixed in the code, but they aren't.
Look here in the history:
http://www.ogre3d.org/wiki/index.php?ti ... ample_code

In the next time (if I have enough motivation to do) I want to publish my (tiny) modificated code. But before I must seperate it from my project. Also will try to use MOIS instead an own solution of key status. In the past I did not know what MOIS is and how to use. Later Raygeee added information about to the wiki.
Beauty wrote: General question about the C++ version number:

In the wiki is the Code of version 015 (C++) and on the developer-website is the version 016.
Is there a reason, why it's not updated? What are the differences? I did not found information about in this thread.
Also:
The title of this forum thread is BetaGUI 2.5 [...].
And in the wiki top right box is written Latest Version 1.0'15
This is confusing. What is right?
... I'm sad about that there was no answer :(
funguine
Gnoblar
Posts: 10
Joined: Mon Jan 15, 2007 5:28 pm
Location: Oulu, Finland
x 1

Post by funguine »

Beauty wrote:I got it to run, but I was not happy with it.
Re-creation of the UI: sounds like a namespace issue; for a reason
or another you propably make Mogre angry for trying to create something
with a name that was used previously and not cleaned up right.

Mouse Coordinates: strange. My code has worked in our studio with different versions of Windows/DirectX/OpenGL. But you'd really like to implement it using MOIS in a serious application anyway.
Beauty wrote: General question about the C++ version number:
The title of this forum thread is BetaGUI 2.5 [...].
And in the wiki top right box is written Latest Version 1.0'15
This is confusing. What is right?
2.5 = 015 = 1.0'15 or whatever. MogerBetaGUI was ported from this version. Differences to 016/others are explained in the thread.
dsl9
Gnoblar
Posts: 1
Joined: Mon Jun 02, 2008 4:38 pm

Post by dsl9 »

Totally noob here. Anyone can show me a functional example for version 2.5?

I mean...the entire file to make a simple menu with a button or something?

Thanks in advance.
User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

Post by toglia »

My program just need buttons and a pointer, can I use the smaller version (0.15 I think) on Ogre 1.4?
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

Should be able to.
User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

Can't use abolute positioning with OIS mouse and BetaGUI

Post by toglia »

Hello!

I'm using BetaGui with a touch screen so I had to change my update cursor code from relative to absolute positioning, but now my cursor seems to be trapped in a 51 x 51 box in the higher right side of the screen. It can move ok, but I cant get it out of there.

Image

This is my init code:

Code: Select all

mGUI = new BetaGUI::GUI("Fondo1Material","Ocra10",24);
	mGUI->injectMouse(0,0,false);
	mPointer = mGUI->createMousePointer(Vector2(32,32), "bgui.pointer"); 

	
	mGUIWindow = mGUI->createWindow(
		Vector4(0,0,
		mViewport1->getActualWidth(),
		mViewport1->getActualWidth()), 
		"bgui.window", BetaGUI::NONE);

	
	cb = new BetaGUI::Callback(this);
This is my update:

Code: Select all

const OIS::MouseState &ms = mouse->getMouseState();

	mouseX = ms.X.abs;
	mouseY = ms.Y.abs;

	
	if (ms.buttonDown(OIS::MB_Left)){
		mGUI->injectMouse(mouseX, mouseY, true);
	}else{
		mGUI->injectMouse(mouseX, mouseY, false);
	}
I would appreciate any help
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

Perhaps it is an issue with OIS? Try setting the width and height of the MouseState to the size of the window. Look in OISMouse.h for more info.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Post by betajaen »

It does sound like an input problem. BetaGUI only accepts absolute positioning of the cursor and usually doesn't moan about where you put it next.
User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

Post by toglia »

this fixed it:

Code: Select all

mouse->getMouseState().width = 1024;
mouse->getMouseState().height = 768;
(on the init)

Sorry to bother...
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39

Post by Beauty »

For MogreBetaGUI someone wrote the additional functions createAlterableOverlay() and createAlterableText().
This is nice to display text that changes every frame (e.g. to show fps).

The source is C#, but I think it's not difficult to port it.
www.ogre3d.org/phpBB2addons/viewtopic.php?p=47533#47531
If someone port it, it would be good to add the code block to the wiki.

If there is still a solution for that, sorry for the redundant post.
I don't remember all the posts of this thread and don't want to read it again now.
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.