[GUI] button is not shown

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
chaoslion
Posts: 25
Joined: Sun Oct 30, 2005 1:44 pm

[GUI] button is not shown

Post by chaoslion »

i noticed something strange, if i add a button like this:

Code: Select all

IGUIButton *btn = Gui->addButton(rect<s32>(10,10,100,50),0,0,L"test");
and then another:

Code: Select all

IGUIButton *btn2 = Gui->addButton(rect<s32>(10,70,100,50),0,0,L"test2");
the 2nd button is not shown, just the first one.
all i wanted to to is, add another button directly under the 1st one but i does not work at all..if theres a bug?![/code]
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Your second button has a height of -20... Try this...

Code: Select all

IGUIButton *btn2 = Gui->addButton(rect<s32>(10,70,100,110),0,0,L"test2"); 
chaoslion
Posts: 25
Joined: Sun Oct 30, 2005 1:44 pm

Post by chaoslion »

yes that was the mistake i made but how come that irrlich does not correct
the width/height itself??
actually this must be the same rect but with different origin but they arent the same?!
rectangle(0,0,320,240) != rectangle(10,10,320,240);
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

You don't define the width/height. You define the top left and the right bottom corners. ;)
Post Reply