Jump to content

Multiple "spotlights" that follow player/enemies


Recommended Posts

Hey all,


I would like to have my game completely blacked out, except for masked out areas around each player and enemy, to simulate being in pitch blackness.


I tried using a Graphics object, but it only works for the first primitive drawn to the screen (so I would only be able to do it around the first entity), and it would not allow for soft edges.


BitmapData would get expensive because I would need to re-render the BitmapData each frame and it would have to get transferred to a WebGL buffer every frame, which I would imagine would impair performance.


Is this possible? Even just a broad idea of how something like this could be achieved would be helpful.

Attached is a mockup of the effect I hope to achieve.


Thanks, I really appreciate it!


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...