DrawPixMap w/Alpha
BlitzMax Forums/BlitzMax Beginners Area/DrawPixMap w/Alpha
| ||
I'm having the hardest time with pixmaps hear.... I just want to DrawPixmap and have the alpha values blend in with what's behind it. Is that possible? |
| ||
If your pixmap is an RGBA, and you have ALPHA_BLEND blending enabled, it should work as desired, except that you don't want to use DrawPixmap. Load it into a TImage first and draw that instead. (yes, really!) |
| ||
pixmaps don't work that way. you have to convert it to an image first for it to be displayed as you want them to. |
| ||
You guys are brilliant! I just can't seem to turn it into a texture now...LoadTexture(Image) LoadTexture(Image.ToString()) |
| ||
a TImage is a texture really (with a TPixmap as the raw backing data) - DrawImage img, x, y |
| ||
mhmm I still can't seem to apply an TImage as a TTexture to a mesh....Local Mesh:TMesh = LoadMesh("tankturret.b3d") Local Texture:TTexture = LoadTexture("tanktext.png") BeginMax2d() SetClsColor(255,0,0) Cls SetBlend ALPHABLEND Local aImage:TImage = LoadImage(Texture.Pixmap) DrawImage(aImage,0,0) Flip GrabImage(aImage,0,0) Texture.Pixmap = LockImage(aImage) UnlockImage(aImage) EndMax2d() EntityTexture(Mesh,Texture) :/ |
| ||
Ah... a texture texture... you have ventured into the realms of minib3d, of which I am unfortunately unfamiliar... |