Transparent part of sprite

BlitzMax Forums/BlitzMax Programming/Transparent part of sprite

FantomKite(Posted 2009) [#1]
Hi to all.
In my game scene i have a background layer, then the next layer witch contains moving sprites of smoke clouds. I want to make a radial transparency around mouse pointer -- to explore the background by mouse moving. This 'window' must be radial. Any advices?


smilertoo(Posted 2009) [#2]
a png with alpha mask.


FantomKite(Posted 2009) [#3]
smilertoo, could you please show me a simple example of how that 'alpha mask' works? Note that i have a layer of sprites, not just one sprite. Thanks for answer!


smilertoo(Posted 2009) [#4]
No, ive never done it.


Brucey(Posted 2009) [#5]
Just create a PNG with an Alpha mask in your favourite paint program.

You should enable ALPHABLEND for it to show properly in BlitzMax. eg.
SetBlend ALPHABLEND

otherwise, you just get a solid background - where it should be transparent.


xMicky(Posted 2009) [#6]
something like this ?




Jur(Posted 2009) [#7]
He would like a movable "window" through a layer of images. In theory, you would need a separate alpha mask applied to images on this layer. I guess this could be achieved with pixmaps, but required code would be complicated and slow.


FantomKite(Posted 2009) [#8]
Actually i am, Jur's right. As i see, there is no easy solution to do this.. Anyway, thanks to all!


xMicky(Posted 2009) [#9]
Reading your post again I think you might something mean like this (quick hack, needs lot of optimization, but runs already nice on my Notebook - also try the alternatives of displaying the scopes circle)...if this again isn't what you are looking for then then I finally be quiet ;)




FantomKite(Posted 2009) [#10]
Yes!! It is what i was looking for! Thanks, xMicky.