Page 1 of 1

Button and image

Posted: Wed Apr 18, 2007 4:26 pm
by PlayG7SeveN
I WANT THE PICTURE TO ADD ON Button


I WANT TO ADD THE PICTURE NAMED start.png

video::ITexture* image = driver->getTexture("media/start.png");
guienv->addButton(rect<s32>(10,250,100,250 + 32), 0, 101,L"Start The Game");

HOW CAN I ADD ?

I THANK FOR YOUR ANSWERS RIGHT NOW

Posted: Wed Apr 18, 2007 6:03 pm
by spopo
I think you should use draw2DImage. You'll just have to guess the coordinates so the image would look like it's on the button.

For example:

Code: Select all


driver->draw2DImage(image, core::position2d<s32>(x,y));

And i just found out that a button has a method called setImage();

Try this :

Code: Select all

gui::IGUIButton *button = guienv->addButton(core::rect<s32>(10,250,100,250 + 32), 0, 101,L"Start The Game");
button->setImage(image);

Posted: Wed Apr 18, 2007 6:22 pm
by Luben
Don't scream, nobody will want to help you. Go hit some imaginary orcs instead of letting your frustration spill out on the forums.

Posted: Thu Apr 19, 2007 12:40 pm
by PlayG7SeveN
thanks

Posted: Tue Apr 24, 2007 3:40 pm
by eneru