Flashlight Effect

BlitzMax Forums/BlitzMax Programming/Flashlight Effect

mothmanbr(Posted 2008) [#1]
Anyone knows of a good and easy way to make a "flashlight" for the game? Darkening the screen and applying a light makes everything grayish, obviously, and the only way I can think of is make an image with a black rectangle larger than the screen with a hole in the middle.

I'm sure there must be a simpler way.


Dreamora(Posted 2008) [#2]
there is no simpler way than drawing a sprite / image with a hole over it at the end.

there are only a hand full of far more complex methods


xlsior(Posted 2008) [#3]
You could have an almost black square and an almost black square with a circular hole in the middle.

Center the one with the hole over the part of the screen you're looking at, and tile the solid square over the rest of the screen to darken it out.

If you use alphablend, you can have a little alpha in the image and show a bit of detail through the solid image, and also use a soft edge/transition around your light spot.