staticclearMask()

staticclearRect(x, y, width, height)

Erase the pixels in the given rectangular area by setting them to transparent black (rgba(0,0,0,0)).

Parameters:

Name

Type

Description

x

Number

x axis of the coordinate for the rectangle starting point.

y

Number

y axis of the coordinate for the rectangle starting point.

width

Number

The rectangle's width.

height

Number

The rectangle's height.

staticclipRect(x, y, width, height)

clip the given region from the original canvas. Once a region is clipped,
all future drawing will be limited to the clipped region.
You can however save the current region using the save(),
and restore it (with the restore() method) any time in the future.
(this is an experimental feature !)

staticdrawImage(image, sx, sy, sw, sh, dx, dy, dWidth, dHeight)

Draw an image to the gl context

Parameters:

Name

Type

Description

image

Image

An element to draw into the context. The specification permits any canvas image source (CanvasImageSource), specifically, a CSSImageValue, an HTMLImageElement, an SVGImageElement, an HTMLVideoElement, an HTMLCanvasElement, an ImageBitmap, or an OffscreenCanvas.

sx

Number

The X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.

sy

Number

The Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.

sw

Number

The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.

sh

Number

The height of the sub-rectangle of the source image to draw into the destination context.

dx

Number

The X coordinate in the destination canvas at which to place the top-left corner of the source image.

dy

Number

The Y coordinate in the destination canvas at which to place the top-left corner of the source image.

dWidth

Number

The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.

dHeight

Number

The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.

Example

// Position the image on the canvas:
renderer.drawImage(image, dx, dy);
// Position the image on the canvas, and specify width and height of the image:
renderer.drawImage(image, dx, dy, dWidth, dHeight);
// Clip the image and position the clipped part on the canvas:
renderer.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);

staticdrawPattern(pattern, x, y, width, height)

Draw a pattern within the given rectangle.

Parameters:

Name

Type

Description

pattern

me.video.renderer.Texture

Pattern object

x

Number

y

Number

width

Number

height

Number

See:

me.WebGLRenderer#createPattern

staticfillArc(x, y, radius, start, end, antiClockwiseopt)

Fill an arc at the specified coordinates with given radius, start and end points

Parameters:

staticsetGlobalAlpha(alpha)

Parameters:

Name

Type

Description

alpha

Number

0.0 to 1.0 values accepted.

staticsetLineWidth(width)

Set the line width

Parameters:

Name

Type

Description

width

Number

Line width

staticsetMask(maskopt)

A mask limits rendering elements to the shape and position of the given mask object.
So, if the renderable is larger than the mask, only the intersecting part of the renderable will be visible.
Mask are not preserved through renderer context save and restore.