Class: BitmapMask

Phaser.Display.Masks. BitmapMask

[description]


new BitmapMask(scene, renderable)

Parameters:
Name Type Description
scene Phaser.Scene

[description]

renderable Phaser.GameObjects.GameObject

A renderable Game Object that uses a texture, such as a Sprite.

Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 9)

Members


bitmapMask :Phaser.GameObjects.GameObject

A renderable Game Object that uses a texture, such as a Sprite.

Type:
Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 38)

dirty :boolean

[description]

Type:
  • boolean
Since: 3.0.0
Default Value:
  • true
Source: src/display/mask/BitmapMask.js (Line 67)

invertAlpha :boolean

[description]

Type:
  • boolean
Since: 3.1.2
Source: src/display/mask/BitmapMask.js (Line 95)

mainFramebuffer :WebGLFramebuffer

[description]

Type:
  • WebGLFramebuffer
Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 77)

mainTexture :WebGLTexture

[description]

Type:
  • WebGLTexture
Since: 3.0.0
Default Value:
  • null
Source: src/display/mask/BitmapMask.js (Line 57)

maskFramebuffer :WebGLFramebuffer

[description]

Type:
  • WebGLFramebuffer
Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 86)

maskTexture :WebGLTexture

[description]

Type:
  • WebGLTexture
Since: 3.0.0
Default Value:
  • null
Source: src/display/mask/BitmapMask.js (Line 47)

renderer :Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer

A reference to either the Canvas or WebGL Renderer that this Mask is using.

Type:
Since: 3.11.0
Source: src/display/mask/BitmapMask.js (Line 29)

Methods


destroy()

Destroys this BitmapMask and nulls any references it holds.

Note that if a Game Object is currently using this mask it will not automatically detect you have destroyed it,
so be sure to call clearMask on any Game Object using it, before destroying it.

Since: 3.7.0
Source: src/display/mask/BitmapMask.js (Line 205)

postRenderCanvas(renderer)

[description]

Parameters:
Name Type Description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

[description]

Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 192)

postRenderWebGL(renderer)

[description]

Parameters:
Name Type Description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

[description]

Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 164)

preRenderCanvas(renderer, mask, camera)

[description]

Parameters:
Name Type Description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

[description]

mask Phaser.GameObjects.GameObject

[description]

camera Phaser.Cameras.Scene2D.Camera

The Camera to render to.

Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 177)

preRenderWebGL(renderer, maskedObject, camera)

[description]

Parameters:
Name Type Description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

[description]

maskedObject Phaser.GameObjects.GameObject

[description]

camera Phaser.Cameras.Scene2D.Camera

The Camera to render to.

Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 149)

setBitmap(renderable)

[description]

Parameters:
Name Type Description
renderable Phaser.GameObjects.GameObject

A renderable Game Object that uses a texture, such as a Sprite.

Since: 3.0.0
Source: src/display/mask/BitmapMask.js (Line 136)