Button and image

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
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

Button and image

Post 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
spopo
Posts: 33
Joined: Wed Mar 28, 2007 1:46 pm

Post 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);
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post 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.
If you don't have anything nice to say, don't say anything at all.
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

Post by PlayG7SeveN »

thanks
eneru
Posts: 40
Joined: Tue Apr 10, 2007 8:38 am

Post by eneru »

Post Reply