Image has transparent bits which come out black when loaded

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
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Image has transparent bits which come out black when loaded

Post by Mani2010 »

My image has transparent bits which come out black when loaded into the game. i have left bits of it transparent on purpose but something happens to it when it get loaded, all the transparent bits become black.

The image is .png and 32x32 if that helps

Anyone know whats going on?
Mag-got
Posts: 42
Joined: Tue Dec 04, 2007 5:53 pm

Post by Mag-got »

You have to load it with the right settings. If you're applying it to a node, you must set the nodes material type to EMT_TRANSPARENT_ALPHA_CHANNEL with

Code: Select all

node->setMaterialType(E_MATERIAL_TYPE);
for example.
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Post by Mani2010 »

Found it!

I had a look at the drawImage() function again and right at the end is a "bool useAlphaChannelOfTexture = false". Works great now.

Thanks for the reply, will need that for my 3d objects
Post Reply