Creating a Flashlight or Spotlight Effect in Phaser 3 using a RenderTexture and alpha masks.

Posted on 7th Apr 2021. Follow @phaser_ and get the Phaser World newsletter.

image

Tommy Leung from Ourcade presents a new tutorial: "Creating a spotlight or flashlight effect in Phaser 3 is fairly simple once you know how to use alpha masks.

You can also use this technique for a “magic lens” effect or anything that involves revealing hidden information.

If you are not familiar with using alpha masks in Phaser 3 then check out this first.

In this article, we will be building on the code example from our Reveal Effect in Phaser 3 with Alpha Masks to create a flashlight effect that illuminates a darkened Phaser logo."

Read More


The first book on the creation of HTML5 cross platform games using Phaser 3 and other free software.
  • By Emanuele Feronato
  • 155 Pages
  • 28 Source Code Examples
  • Build a complete game from start to finish
  • Cross Platform
  • Scaling for devices
Buy Now
$19