Hi I am new at Irrlicht. I tried to add additional buttons just like the user interface example in the irrlicht source. But I have realized that I can only add elements into small portion of the created window here is my code. the problem is it cannot draw the second button in the window. how can I fix this problem. thanks in advance..
[code]
IGUIWindow* window = env->addWindow(
rect<s32>(100 , 100, 300 , 300),
true, // modal?
L"Test window",env->getRootGUIElement(),100);
env->addButton(rect<s32>(35,35,100,50),
window,
101,
L"Quit",
L"Exits Program");
env->addButton(rect<s32>(35,100,100,50),
window,
102,
L"Restart",
L"Restarts the Program");
[/code]
IGUIWindow adding additional element problem
-
- Posts: 60
- Joined: Tue Nov 13, 2007 7:03 pm
- Location: Bucharest - Romania
- Contact:
rect<s32> doesn't have x, y, sizeX, sizeY ... it has x1, y1, x2, y2 ... so try:
Code: Select all
env->addButton(rect<s32>(35, 35, 100, 50),...);
env->addButton(rect<s32>(35, 100, 100, 115),...);
rect<s32>() has more than one constructor, including one that uses:
core::position2d<s32>()
core::dimensio<s32>()
wich is much more intuitive when creating GUI elements
now.. the prblem here as darbolovan pointed out u have is that u the y2 parameter is lower than the y1 parameter... u might be better of doing something like this
core::rect<s32>(core::position2d<s32>(35, 35), core::dimension2d<s32>(100, 50))
Best regards
core::position2d<s32>()
core::dimensio<s32>()
wich is much more intuitive when creating GUI elements
now.. the prblem here as darbolovan pointed out u have is that u the y2 parameter is lower than the y1 parameter... u might be better of doing something like this
core::rect<s32>(core::position2d<s32>(35, 35), core::dimension2d<s32>(100, 50))
Best regards