I need help about button

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.
Post Reply
neppyweb
Posts: 22
Joined: Thu Nov 23, 2006 12:44 pm

I need help about button

Post by neppyweb »

I have an Idea to modify the tutorial 12 to function and use the button from tutorial 5 to call that function but the trouble is occured.

For easy to think,
When program run tutorial 5 successful the buttons will appear.
Next when I click at button "New Game" the program will call function and draw the terrain (tutorial 12) but the problem is the button still appear
This is code in main() //Tutorial 5

env->addButton(rect<s32>(300,250,500,290), 0, 102, L"New Game"); // when click this button it will call function
env->addButton(rect<s32>(300,350,500,390), 0, 103, L"Load Game");
env->addButton(rect<s32>(300,450,500,490), 0, 101, L"Exit");
while(device->run() && driver)
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,0,0,0));

env->drawAll();
driver->endScene();

}

device->drop();

return 0;
And this is code in function// look like Tutorial 12
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0 );

smgr->drawAll();
env->drawAll();

driver->endScene();

// display frames per second in window title
int fps = driver->getFPS();
if (lastFPS != fps)
{
str += driver->getName();
str += "] FPS:";
str += fps;

device->setWindowCaption(str.c_str());
lastFPS = fps;
}


}

device->drop();
What should I do to clear the first "env"

Thank you...
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

see vitek's post here-
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=18059

this question gets asked a lot and is even in the feature requests. I'll add a clear method to the gui environment sometime soon.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
neppyweb
Posts: 22
Joined: Thu Nov 23, 2006 12:44 pm

Post by neppyweb »

Thank you for your kindness
Post Reply