If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
-
Repgahroll
- Posts: 88
- Joined: Tue Jul 29, 2008 11:48 am
Post
by Repgahroll »
I have two texts which i want to be shown, but one at time!
I have a bool, and if is true, i want 'text one' to be shown, if false i want "text two" to replace text one.
what's wrong??
Code: Select all
if (variable == true)
{
textvar=device->getGUIEnvironment()->addStaticText(L"text one",pos);
}
else
if (variable == false)
{
textvar=device->getGUIEnvironment()->addStaticText(L"text two",pos);
}
Thanks in advance!
Sorry my english and my noobness:D hehe
-
Repgahroll
- Posts: 88
- Joined: Tue Jul 29, 2008 11:48 am
Post
by Repgahroll »
nevamind!
'setText' is the answer!
Thanks anyway!
-
almondega
- Posts: 37
- Joined: Sat Jun 21, 2008 2:14 am
Post
by almondega »
just a performance tip
if (variable == true) { .... }
else { ... }
as variable is bool, it only can be one thing if the first doesnt work, so, avoid the "if = false"
or better: (but ugly)
textvar=device->getGUIEnvironment()->addStaticText(variable?L"text one":L"text two",pos);
-
Repgahroll
- Posts: 88
- Joined: Tue Jul 29, 2008 11:48 am
Post
by Repgahroll »
Thanks... but anotha problem appeared!
Everything is okay BUT, if i click the left mouse button the text replacin thing stop working!
Dunno why... theres no reason i can see!
-
almondega
- Posts: 37
- Joined: Sat Jun 21, 2008 2:14 am
Post
by almondega »
i didnt work with gui yet
but i saw in some topics to pay attencion when using event managers + gui
because gui has its own event manager (i think)
-
Repgahroll
- Posts: 88
- Joined: Tue Jul 29, 2008 11:48 am
Post
by Repgahroll »
OK... but the mouse isn't being used on the whole program!
.
EDIT:
Nevaminddieth!!!
: D
: D:D :DD:D:
now everything just work!
Dunno what was happenin, i just re-write everathing and now works like a charm! pretty help here! Thank you vary muche guys!
Sorry mä english!
-
JP
- Posts: 4526
- Joined: Tue Sep 13, 2005 2:56 pm
- Location: UK
-
Contact:
Post
by JP »
almondega wrote:
because gui has its own event manager (i think)
nope... all events go through the same system and come into your Event Receiver implementation that you've registered with the device.