0

I'm trying to make a GUI and I want to create some buttons. I can create my button with

irr::gui::IGUIButton *newGameButton = gui->addButton(irr::core::rect<irr::s32>(200, 110, 600, 200), 0, -1, L"NEW GAME");

If I want to draw an image I can set my position but I can't do it with a button.

->draw2DImage(image,
                 irr::core::position2d<irr::s32>(145,30),
                 irr::core::rect<irr::s32>(0,0,500,180),
                 0,
                 irr::video::SColor (255,255,255,255),
                 true);

Here can i set the position with an image! I read the documents and tutorial but i can't find it.

Eby Jacob
  • 1,418
  • 1
  • 10
  • 28
YPR
  • 33
  • 6

1 Answers1

0

To change a button's position programmatically, you can do the following :

newGameButton->setRelativePosition( rect<s32>( 210, 110, 610, 200 ));

... for example, this will draw the button 10 pixels more on the right.

MartinVeronneau
  • 1,296
  • 7
  • 24