Skip to content

$fillText

Draws a text.

Usage

$fillText[canvas;text;style;font;x;y;maxWidth?;align?;baseline?;multiline?;wrap?;lineOffset?]

Parameters

FieldTypeDescriptionRequired
canvasStringName of the canvas to set the fill style in.True
textStringThe text to draw.True
styleColor | Gradient | PatternThe text style.True
fontStringThe text font.True
xNumberThe text X coordinate.True
yNumberThe text Y coordinate.True
maxWidthNumberMaximum text width.False
align”end” | “left” | “center” | “right” | “start”The text align.False
baseline”top” | “hanging” | “middle” | “alphabetic” | “ideographic” | “bottom” | 0 | 1 | 2 | 3 | 4 | 5The text baseline.False
multilineBooleanIndicates if the text should be drawn in multiple lines if it exceeds the maximum width.False
wrapBooleanWraps the text if true.False
lineOffsetNumberThe line offset.False

Example(s)

No examples for this function.

meow

Raw Info

{
"name": "$fillText",
"description": "Draws a text.",
"params": [
{
"name": "canvas",
"description": "Name of the canvas to set the fill style in.",
"type": "String",
"required": true
},
{
"name": "text",
"description": "The text to draw.",
"type": "String",
"required": true
},
{
"name": "style",
"description": "The text style.",
"type": "Color | Gradient | Pattern",
"required": true
},
{
"name": "font",
"description": "The text font.",
"type": "String",
"required": true
},
{
"name": "x",
"description": "The text X coordinate.",
"type": "Number",
"required": true
},
{
"name": "y",
"description": "The text Y coordinate.",
"type": "Number",
"required": true
},
{
"name": "maxWidth",
"description": "Maximum text width.",
"type": "Number",
"required": false
},
{
"name": "align",
"description": "The text align.",
"type": "\"end\" | \"left\" | \"center\" | \"right\" | \"start\"",
"required": false,
"enum": {
"start": "end",
"right": "left",
"center": "center",
"left": "right",
"end": "start"
}
},
{
"name": "baseline",
"description": "The text baseline.",
"type": "\"top\" | \"hanging\" | \"middle\" | \"alphabetic\" | \"ideographic\" | \"bottom\" | 0 | 1 | 2 | 3 | 4 | 5",
"required": false,
"enum": {
"0": "top",
"1": "hanging",
"2": "middle",
"3": "alphabetic",
"4": "ideographic",
"5": "bottom",
"top": 0,
"hanging": 1,
"middle": 2,
"alphabetic": 3,
"ideographic": 4,
"bottom": 5
}
},
{
"name": "multiline",
"description": "Indicates if the text should be drawn in multiple lines if it exceeds the maximum width.",
"type": "Boolean",
"required": false
},
{
"name": "wrap",
"description": "Wraps the text if true.",
"type": "Boolean",
"required": false
},
{
"name": "lineOffset",
"description": "The line offset.",
"type": "Number",
"required": false
}
],
"usage": "$fillText[canvas;text;style;font;x;y;maxWidth?;align?;baseline?;multiline?;wrap?;lineOffset?]",
"category": "canvas",
"src": "https://github.com/devlordduck/aoi.canvas/tree/v2/src/functions/canvas/fillText.ts",
"docs": "https://aoicanvas.vercel.app/functions/filltext"
}