Making an image transparent?

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
JJJohan
Posts: 7
Joined: Thu Dec 18, 2008 11:49 am
Location: Brisbane, Australia
Contact:

Making an image transparent?

Post 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?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Just change the alpha of the image color and tell the draw2dimage to take vertex alpha into account.
JJJohan
Posts: 7
Joined: Thu Dec 18, 2008 11:49 am
Location: Brisbane, Australia
Contact:

Post by JJJohan »

Hmm, well I just stuck with making the image transparent in Photoshop which worked for me.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, this won't enable simply change of the transparency at runtime, though, but it also works as expected :)
Post Reply