Hi, I am trying to draw individual GUI buttons instead of using device->getGUIEnvironment()->drawAll(), but I can't seem to get it to work, I'm not sure if I am supposed to do button.draw(),button->draw(),button::draw() or draw(button), as all have their own errors and I cant find a example anywhere.
Any help would be great, thanks!
Drawing Individual GUI Elements
Re: Drawing Individual GUI Elements
http://irrlicht.sourceforge.net/docu/cl ... ement.html
post your code, but this should be:
element->draw();
post your code, but this should be:
element->draw();
Re: Drawing Individual GUI Elements
Maybe also describe _why_ you would want to do that. I can't really think of many situations where it would make sense to call them individually. So you might be misunderstanding something else and don't even need to do that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Drawing Individual GUI Elements
Sorry I wasnt clear enough before, I want to only draw some buttons instead of all of them, mostly because the buttons play a little animation of the camera moving from point A to B, but sometimes there is a wall in the way, so I dont want the user to be able to hit the button to go straight if there is a wall in front of them, so I would make the button invisible/un draw it.
As for the code itself, taking another look at it, I think I messed up by linking the button with the GUI enviroment
I have been trying to create a IGUIButton, but can't find a example of how to do it anywhere without setting a parent, a quick example should send me on my way =D
As for the code itself, taking another look at it, I think I messed up by linking the button with the GUI enviroment
Code: Select all
env ->addButton(rect<s32>(400,360,500,360 + 32), 0,GUI_ID_Forward_Arrow_X,L"Go Forward",L"Go");
Re: Drawing Individual GUI Elements
Yeah, passing 0 set's the guienvironment as parent.
But you can use the setVisible function of gui-elements to hide/show them.
But you can use the setVisible function of gui-elements to hide/show them.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm