Page 1 of 1

Making an image transparent?

Posted: Thu Dec 18, 2008 11:52 am
by JJJohan
This is an extremely simple question, and I feel kinda dumb for asking it, but there was NOWHERE where I was able to find an answer to this simple question. I did about 10 different searches and even in the wiki it does not come up.

In the tutorials, this code is used quite often:

Code: Select all

        // add irrlicht logo
        env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"),
                core::position2d<s32>(10,10));
I like how simplistic it is to add an image to the screen, but I want to be able to make the image transparent, yet I can't find the code.

It's probably a really simple line that I'm just constantly skipping over, but I just can't seem to find it! What is it?

Posted: Thu Dec 18, 2008 12:01 pm
by hybrid
Just change the alpha of the image color and tell the draw2dimage to take vertex alpha into account.

Posted: Thu Dec 18, 2008 12:08 pm
by JJJohan
Hmm, well I just stuck with making the image transparent in Photoshop which worked for me.

Posted: Thu Dec 18, 2008 12:16 pm
by hybrid
Ok, this won't enable simply change of the transparency at runtime, though, but it also works as expected :)