Class: Mask

Mask()

new Mask()

A mask can be used to set the drawing region. Masks are treated as objects their shape is used to filter other objects shape. Multiple mask objects can be active simulatenously, they have to be attached to the object mask list to filter the render region. A mask objects is draw using the context.clip() method.
Source:

Methods

clip(context, viewport, canvas)

Clip the canvas context, to ensure that next objects being drawn are cliped to the path stored here.
Parameters:
Name Type Description
context CanvasContext Canvas 2d drawing context.
viewport Viewport Viewport applied to the canvas.
canvas DOM DOM canvas element where the content is being drawn.
Source: