CLASSES
TagsA - Z

DynamicTexture

BaseTextureTexture

Description

class DynamicTexture extends Texture

Constructor

new DynamicTexture(name, options, scene, generateMipMaps, samplingMode, format)

Parameters

Name Type Description
name string Name of the texture
options any This argument can accept an HTMLCanvasElement, an object with a numeric width and height property, or a number. If an HTMLCanvasElement, the provided canvas will be used in the texture including its height and width. If an object with numeric height and width properties is passed, a new canvas will be created internally with the specified height and width. If a number is provided for this argument, a square canvas and texture will be created with the specified height and width.
scene Scene Scene which contain the texture
generateMipMaps boolean @param generateMipMaps
optional samplingMode number

Members

canRescale : boolean

Methods

scale(ratio) → void

Parameters

Name Type Description
ratio number

scaleTo(width, height) → void

Parameters

Name Type Description
width number
height number

getContext() → CanvasRenderingContext2D

Get the context @return CanvasRenderingContext2D The canvas where the game is rendered

clear() → void

update(invertY) → void

Update the dynamic texture

Parameters

Name Type Description
optional invertY boolean Invert the text on Y axis

drawText(text, x, y, font, color, clearColor, invertY, update) → void

Draw a text on view

Parameters

Name Type Description
text string A string with the text
x number The position on X axis of the text to draw
y number The position on Y axis of the text to draw
font string The font of the text to draw
color string The color of the text to draw in hexadecimal
clearColor string The clear color of the text to draw in hexadecimal
optional invertY boolean Invert the text on Y axis

clone() → DynamicTexture