Layer.drawText

Function/Meaning

Character drawing

Type
Layerclassmethod of
Syntax
drawText(x, y, text, color, opa=255, aa=true, shadowlevel=0, shadowcolor=0, shadowwidth=0, shadowofsx=0, shadowofsy=0)
Arguments
x

Specifies the x-coordinate (at the image position) of the origin where the character drawing starts, in pixels.

y

Specifies the y coordinate (at the image position) of the origin where the character drawing starts, in pixels.

text

Specify the character to draw.

color

Specifies the color of the characters to draw in the 0xRRGGBB format.

opa

Specifies the opacity (-255 to 0 to 255) of the characters to draw.
Negative numbers are only valid if Layer.face is dfAlpha, which removes the opacity of the character shape (the smaller the value, the greater the effect).

aa

Specifies whether to perform antialiasing.
If true is specified, antialiasing will be performed.
If you specify false, it will not be done.

shadowlevel

Specifies the opacity of the shadow.
The appropriate value will vary depending on the value of the shadowwidth argument.
If you specify 0, no shadow is drawn.

shadowcolor

Specifies the shadow color in 0xRRGGBB format.

shadowwidth

Specifies the shadow width (blurring).
0 is the sharpest (no blur), and increasing the value will blur the shadow.

shadowofsx

Specifies the x-coordinate value of the shadow position, in pixels.
If you specify 0, the shadow is drawn directly below.

shadowofsy

Specifies the y-coordinate value of the shadow position, in pixels.
If you specify 0, the shadow is drawn directly below.

Return value
None (void)
Explanation

Draws characters on the layer.
It can only be drawn if the Layer.face is dfAlpha (or dfBoth), dfAddAlpha, or dfOpaque (or dfMain).
If you specify dfOpaque (or dfMain), it depends on the Layer.holdAlpha property whether the mask to which it is drawn is destroyed or protected.
The font specified in Layer.font is used.