TextParams

This type is used to determine text alignment.

circle-info

Line alignment only makes sense if you have multiple lines in your text. By default, all next lines will start from the left side of the text. You can change this behavior by using one of the functions that take line as a parameter. For example, if you pass right to the line alignment, all next lines will start from the right side. Text alignment will remain as dictated by v and h parameters.

WithV

Function

Creates TextParams instance with vertical alignment.

Arguments

Name

Type

Description

v

Vertical alignment.

Returns

Type

Description

TextParams

Created text params.

Example

local align_top = draw.TextParams.WithV(draw.TextAlignment.TOP);

WithH

Function

Creates TextParams instance with horizontal alignment.

Arguments

Name

Type

Description

h

Horizontal alignment.

Returns

Type

Description

TextParams

Created text params.

Example


WithLine

Function

Creates TextParams instance with line alignment.

Arguments

Name

Type

Description

line

Line alignment.

Returns

Type

Description

TextParams

Created text params.

Example


WithVH

Function

Creates TextParams instance with vertical and horizontal alignments.

Arguments

Name

Type

Description

v

Vertical alignment.

h

Horizontal alignment.

Returns

Type

Description

TextParams

Created text params.

Example


WithVLine

Function

Creates TextParams instance with vertical alignment and line alignment.

Arguments

Name

Type

Description

v

Vertical alignment.

line

Line alignment.

Returns

Type

Description

TextParams

Created text params.

Example


WithHLine

Function

Creates TextParams instance with horizontal alignment and line alignment.

Arguments

Name

Type

Description

h

Horizontal alignment.

line

Line alignment.

Returns

Type

Description

TextParams

Created text params.

Example


WithVHLine

Function

Creates TextParams instance with vertical, horizontal and line alignments.

Arguments

Name

Type

Description

v

Vertical alignment.

h

Horizontal alignment.

line

Line alignment.

Returns

Type

Description

TextParams

Created text params.

Example

Last updated