Phaser API Documentation

preRenderWebGL(renderer, maskedObject, camera)


Prepares the WebGL Renderer to render a Game Object with this mask applied.

This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame.


name type description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

The WebGL Renderer to prepare.

maskedObject Phaser.GameObjects.GameObject

The masked Game Object which will be drawn.

camera Phaser.Cameras.Scene2D.Camera

The Camera to render to.

Since: 3.0.0