AlphaBlend
BlitzMax Forums/BlitzMax Beginners Area/AlphaBlend
| ||
Hi. I'm new to Blitz Max, moving up from Blitz3D. I was fiddling with some of the animation commands but I am encountering a lot of difficulty with getting the alpha to display properly. The alpha layer seems to just appear white despite that the png file has a transparency layer in it. What am I missing, any help would be greatly appreciated. Here is the relevant code: Notes: Backdrop and Player are both custom types with Image as a simple TImage type storing the image files... ........ ........ ........ 'Setup Backdrop AZTEC_NIGHT:Backdrop = New Backdrop AZTEC_NIGHT.Image = LoadImage("media/AztecNight.jpg") 'Setup Player USER:Player = New Player USER.Position = 400 USER.Image = LoadAnimImage("media/DragonAttack.png", 128, 128, 0, 6) End Function Function DrawAll() 'Draw Backdrop 'SetBlend SOLIDBLEND DrawImage(AZTEC_NIGHT.Image, 0, 0) 'Draw Player SetBlend(ALPHABLEND) DrawImage(USER.Image, USER.Position-64, 600-128) End Function |
| ||
Are you sure that the alpha is exported as alpha? Some apps have the default setting of exporting alpha as pure white instead of real alpha information (or even use them internally to represent alpha - in the pro apps for example you have to use layeralpha or alphamasks to get alpha in your png) |
| ||
I use The GIMP for all of my image processing. I previously worked on a fairly large 3D game in Blitz3D and all of the textures I created that needed translucency and transparency were saved as .png with no problems. Unless there is a different method for loading BlitzMax images then I don't see how that would be the case. But I'll check it again to make sure. Does anyone else see anything wrong with the partial code I've provided? |
| ||
You also need to check your graphics setup alpha images appear different in 16/32 bit screems main probs are with gradiants in the images ie and alpha is a gradiant |
| ||
need to use SetAlpha() |