▶️MayoGL Class

Initialising a canvas

class MayoGL(canvas: DOM Element, options: JSON)

To create a drawing process, just Initialise the class.

Example

var display = new MayoGL(document.getElementById("screen"), 
    {
        width: 800,
        height: 600,
        alpha: true,
        clearColor: '#222',
        pixelSize: 2, 
        antiAlias: true
    }
)

Options

Canvas

A dom canvas element on which it will draw

Options

A list of options you can use to customize your rendering

nameTypeDescriptionDefault Value

width

Number

The width of the canvas

Your canvas default width

height

Number

The height of the canvas

Your canvas default height

alpha

Boolean

Should the canvas be transparent

false

clearColor

String

The background colour if you clear the screen

Black (#000000)

pixelSize

Number

The size of a pixel on the canvas; eg.: if 4, each pixel drawn will take up 4 pixels on the screen.

1

antiAlias

Boolean

Anti Aliasing, smooth picture

false

Last updated