I am trying to create a HUD out of some png images - but whenever I draw the image, it shows white where it should be transparent. The image is saved as a png with an alpha channel, but I tried tga as well with the same result. I am using 3.2 Indie Edition on Linux.
The image file is attached.
Here is my code to load the image:
function Script:Start()
self.texture = Texture:Load("Materials/HUD/hud.tex")
end
And here is my code to draw it:
function Script:PostRender(context)
context:SetBlendMode(Blend.Alpha)
context:SetColor(1, 1, 1)
left = context:GetWidth() - self.texture:GetWidth()
top = context:GetHeight() - self.texture:GetHeight()
context:DrawImage(self.texture,left,top)
context:SetBlendMode(Blend.Solid)
context:Sync();
end
What I think the problem is:
The automated conversion to textures is converting all images to DXCT1 RGB which has no alpha channel, but the working transparent textures that come with the editor use RGBA.