CanvasTexture Class

Extends Texture
Module: Textures

Canvas textures can be used to draw content to the texture during runtime, using the context property.

Canvas textures always start with black background and a red text "Canvas Texture".

Item Index

Properties

Methods

clear

(
  • color
)

Clear canvas texture with a background color.

Uses the internal context to draw a rect to fill the canvas.

Parameters:

  • color String

placeholder

()

Draw a placeholder figure into the canvas texture.

toJSON

(
  • meta
)

Create JSON description for canvas texture, canvas image is not serialized.

Parameters:

  • meta Object

Properties

context

Context2D

Canvas context 2D, can be used to draw content do the canvas texture.

height

Number

Canvas height, internal resolution of the canvas texture.

image

Element

Image is used to store a DOM canvas element.

width

Number

Canvas width, internal resolution of the canvas texture.