I feel dumb - No Sprite Alpha?
Blitz3D Forums/Blitz3D Beginners Area/I feel dumb - No Sprite Alpha?
| ||
img=CreateTexture(256,256) SetBuffer TextureBuffer(img) Color 255,0,0 Oval 0,0,256,256,1 Color 0,0,0 Oval 8,8,240,240,1 Flip SetBuffer BackBuffer() Color 0,255,0 sp=CreateSprite() EntityTexture sp,img I have even tried setting the Texture Flag (on the img texture) to 2 but the sprite refuses to show transparency through the black background. I really dont know what Im missing here! |
| ||
When you use CreateTexture, you have to write the alpha value explicitly to every pixel. Don't ask! ;) |
| ||
OH gawd! *sigh* The only reason I used createtexture was because I just wanted to whip something up quickly hehe (laziness rules!). Oh well, here I go and open paint! Thanks a lot! |
| ||
As soon as you paint to the texturebuffer, the alpha channel is erased. Writing a little ALpha setting function should be easy tho. It also allows not only to use the brightness of a texel for its transparency (as the systems alpha loading does when no alpha channel was found in the file), but for example the red channel, a certain brightness bias and so on. |
| ||
I wish I knew what you were talking about JFK! Lol. IPete2. |
| ||
http://www.blitzbasic.com/Community/posts.php?topic=64678#722116 |