I´m trying to load an image on the GUI for the HUD of my game. The size of this image is the same of the render window. I don´t use all the rectangle of the image for the HUD, because the central area of the image must be transparent in order to let seeing the geme´s action.
Well, I use the irr::video::IVideoDriver::makeColorKeyTexture to make the central part of the image transparent. The problem is that when I run the program, the "transparent" area is not transparent, but black . So of course, it's not possible view the action located at the background. The code I use is like this:
Code: Select all
rect<s32> rectangle = rect<s32>(0,0,640,480);
IGUIImage* pImage = m_pGui->addImage(rectangle,NULL,imageID);
if (pImage == NULL)
return false;
ITexture *pTexture = m_pDriver->getTexture("HUD.jpg");
if (pTexture == NULL)
return false;
SColor keyColor = SColor(255,255,255,255);
m_pDriver->makeColorKeyTexture(pTexture,keyColor);
pImage->setImage(pTexture);
return true;