📘 Renders an image generated from text onto the canvas.
If the first parameter is a string, an image of the text will be created and cached automatically.
The positioning of the image is affected by the current text alignment and baseline settings.
This function can be used to draw emojis, which can not be drawn with MSDF text rendering.
Using this function to draw text that changes every frame has a very high performance cost.
image or text
x-coordinate where the image should be placed
y-coordinate where the image should be placed
await Canvas(200);background(0.8);textSize(96);textAlign(CENTER, CENTER);textImage('🐶', 0, 0); Copy
await Canvas(200);background(0.8);textSize(96);textAlign(CENTER, CENTER);textImage('🐶', 0, 0);
📘 Renders an image generated from text onto the canvas.
If the first parameter is a string, an image of the text will be created and cached automatically.
The positioning of the image is affected by the current text alignment and baseline settings.
This function can be used to draw emojis, which can not be drawn with MSDF text rendering.
Using this function to draw text that changes every frame has a very high performance cost.