Dynamic Alpha Mask?

Monkey Forums/Monkey Programming/Dynamic Alpha Mask?

CopperCircle(Posted 2011) [#1]
Hi, I am trying to create a spotlight effect so the screen is black and the light shows up the background and sprites as it moves about. I can do it with moving about a large alpha png but the performance is bad, I see there are no pixel commands in Monkey, any other way to do it?

Thanks.


muddy_shoes(Posted 2011) [#2]
Are you sure that the spotlight PNG rendering is the cause of your performance problems? What platform are you talking about? How big is the image?

If the area outside of the spotlight is absolutely black then you've no need to draw to it. Try reducing the spotlight image to just large enough for the spot area itself, clearing the playfield to black, setting your drawing scissors to the extents of your spotlight image, then rendering your scene and then the spotlight.


CopperCircle(Posted 2011) [#3]
Thanks, I had not found the scissor command yet, that did the job.