Renders a filled shape (rectangle, circumference or polygon)

maskRenderer.shape    = MaskShape.Rectangle;
maskRenderer.width = 32;
maskRenderer.height = 32;
maskRenderer.color = "#000000";
maskRenderer.offset = new Vector2(0, 0);
maskRenderer.rotation = 0;
maskRenderer.opacity = 1;
maskRenderer.layer = "Default";
maskRenderer.shape    = MaskShape.Circumference;
maskRenderer.radius = 16;
maskRenderer.color = "#000000";
maskRenderer.offset = new Vector2(0, 0);
maskRenderer.opacity = 1;
maskRenderer.layer = "Default";
maskRenderer.shape       = MaskShape.Polygon;
maskRenderer.vertexModel = [new Vector2(0, 0), new Vector2(32, 0), new Vector2(32, 32), new Vector2(0, 32)];
maskRenderer.color = "#000000";
maskRenderer.offset = new Vector2(0, 0);
maskRenderer.opacity = 1;
maskRenderer.layer = "Default";

Constructors

Properties

color: string

The color of the mask

height: number = 0

Mask height in pixels (only for rectangle)

layer: string = defaultRenderLayer

The render layer

offset: Vector2 = ...

X-axis and Y-axis offset

opacity: number = 1

Change the opacity between 1 and 0

radius: number = 0

Mask radius in pixels (only for circumference)

rotation: number = 0

Mask rotation in radians

shape: MaskShape

Mask shape: Rectangle, Circumference or Polygon

vertexModel: Vector2[] = []

Polygon vertices (only for polygon)

width: number = 0

Mask width in pixels (only for rectangle)