Canvas API

Draws the 2D graphics a game needs, such as a game board, a health bar or puzzle pieces. Ask for a 2D game or a sliding puzzle.

Utilities & Storage

Asset stores, saved data, and the core building blocks behind bigger experiences.

Made with this block

Inputs

customFont1font

Optional user-provided font (customFont1): a .ttf/.otf the user uploaded, bound at build time. In scripts select it with canvas.textFont('custom1').

customFont2font

Optional user-provided font (customFont2): a .ttf/.otf the user uploaded, bound at build time. In scripts select it with canvas.textFont('custom2').

customFont3font

Optional user-provided font (customFont3): a .ttf/.otf the user uploaded, bound at build time. In scripts select it with canvas.textFont('custom3').

customFont4font

Optional user-provided font (customFont4): a .ttf/.otf the user uploaded, bound at build time. In scripts select it with canvas.textFont('custom4').

Functions

createCanvasObject

Creates a new Canvas object with a given size in pixels. When no arguments are given (or width=-1, height=-1), it will create a canvas in the screen resolution.

createOnScreenCanvasObject

Creates a new Canvas with screen resolution, and displays it on the screen. Returns a Canvas object.