I tried every function i found in the docu, to draw a 2d image with an alpha value, but nothing seams to work.
F.e. I made this function, which draws an 2d image at every resolution at the same position with same size:
#define SX(val) ( (int)(device->getVideoDriver()->getScreenSize().Width*(float)(val)/1280.0f) )
#define SY(val) ( (int)(device->getVideoDriver()->getScreenSize().Height*(float)(val)/960.0f) )
void CGame::DrawHUDElement(core::position2d<s32> pos, video::ITexture* texture, int alpha)
{
video::IVideoDriver* driver = device->getVideoDriver();
core::dimension2d<s32> size = texture->getOriginalSize();
driver->draw2DImage(texture, core::position2d<s32>(SX(pos.X), SY(pos.Y)), core::rect<s32>(0,0, size.Width, size.Height), NULL, video::SColor(alpha, 255,255,255), false );
}
But the alpha values is not used, the image is not transparent.
If I set the last paramter to true, the image is transparent, but the alpha values is completly ignored.
Is there another way of drawing a 2d image, is this a bug ?
Thanks
Artur Hallmann