CanvasTexture
The CanvasTexture class represents a drawable canvas within the engine framework, allowing for the creation and manipulation of textures through various drawing operations, making it ideal for dynamic visual content generation and customization in applications requiring real-time graphical updates.
Inherits from
Usage
To use this class, add the following require at the top of your script:
Reference
create
Create a new canvasTexture
Parameters
selfattributes(table): list of attributes. without, the canvasTexture will be created with default values
Returns
CanvasTexture: of the created canvasTexture.
getMaterial
Get the alpha map of the material.
Returns
Texture: alpha map texture.
getTexture
Get the texture.
Returns
Texture: texture.
clear
drawRect
Parameters
lefttopwidthheightcolorradius
clearRect
Parameters
lefttopwidthheight
drawTexture
Parameters
texturelefttopwidthheighttint
drawText
Parameters
textlefttopfontSizefontcolor
render
measureText
Parameters
textfontSizefont