Skip to content

$strokeText

Draws a stroked (outlined) text.

Usage

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

Parameters

FieldTypeDescriptionRequired
canvasStringName of the canvas to draw the text on.True
textStringThe text to draw.True
styleColor | Gradient | PatternThe text style.True
fontStringThe text font.False
xNumberThe X coordinate of the text.True
yNumberThe Y coordinate of the text.True
lineWidthNumberThe stroke (outline) width.False
maxWidthNumberThe text max 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": "$strokeText",
"description": "Draws a stroked (outlined) text.",
"params": [
{
"name": "canvas",
"description": "Name of the canvas to draw the text on.",
"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": false
},
{
"name": "x",
"description": "The X coordinate of the text.",
"type": "Number",
"required": true
},
{
"name": "y",
"description": "The Y coordinate of the text.",
"type": "Number",
"required": true
},
{
"name": "lineWidth",
"description": "The stroke (outline) width.",
"type": "Number",
"required": false
},
{
"name": "maxWidth",
"description": "The text max 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": "$strokeText[canvas;text;style;font?;x;y;lineWidth?;maxWidth?;align?;baseline?;multiline?;wrap?;lineOffset?]",
"category": "canvas",
"src": "https://github.com/devlordduck/aoi.canvas/tree/v2/src/functions/canvas/strokeText.ts",
"docs": "https://aoicanvas.vercel.app/functions/stroketext"
}