Transparent Images on Buttons?

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
Jorik
Posts: 44
Joined: Tue Dec 08, 2009 4:47 pm

Transparent Images on Buttons?

Post by Jorik »

Hi,

i created a some button images and mapped them with:

Code: Select all

->setImage()
on the buttons.

But i have a problem: the images doesnt fit 100 % on the buttons.
because of this i created some transparency at the outline of the painted button pictures.

If i map them now the transparency didnt work, it is shown as white.

Is there any way to activate transparency at the button image and dont let me see the button behind?
Jorik
Posts: 44
Joined: Tue Dec 08, 2009 4:47 pm

Post by Jorik »

Ok, i solved my problem:

i used:

Code: Select all

testbutton->drawBoarder(false)

testbutton->setUseAlphaChannel(true)


I have many buttons, so my question is:

Can this both functions be activated global for all buttons ?
CuteAlien
Admin
Posts: 10021
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

No, you can't change the defaults in Irrlicht. But certainly you are free to write your own function to add buttons which does that stuff.
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
Jorik
Posts: 44
Joined: Tue Dec 08, 2009 4:47 pm

Post by Jorik »

ok, thanks
Post Reply