Skip to main content

DynamicDrawOptions

Index

Properties

angle

angle: number

The angle at which the text should be drawn, relative to the center of the circle. Angles are measured clockwise in radians starting at the vertical 12 o'clock position. For example 0 corresponds to 12 o'clock, PI/2 corresponds to 3 o'clock, PI corresponds to 6 o'clock, and 3PI/2 corresponds to 9 o'clock. Only applicable to the DynamicDrawTextArc function. Defaults to 0.

color

color: string

The color that the text should be drawn in. Can be any valid CSS color string. Defaults to "#000".

contain

contain: boolean

Whether or not the text should be fully contained in the box defined by the from/to coordinates. Only applicable to the DynamicDrawTextFromTo function. Defaults to true.

direction

direction: number

The direction the text should be drawn in along the circular arc. Only applicable to the DynamicDrawTextArc function. Defaults to DynamicDrawTextDirection.CLOCKWISE;

effect

effect: burn

A dynamic text effect to apply. No effects are applied by default.

fontFamily

fontFamily: string

The desired font family to draw text in. This can be a single font name, or a full CSS font stack (e.g. "'Helvetica', 'Arial', sans-serif"). Defaults to the player's chosen global font.

fontSize

fontSize: number

The target font size. Note that if space is constrained, the actual drawn font size will be reduced automatically to fit. Defaults to 30px.

maxAngle

maxAngle: number

The maximum angle that the text should be drawn along. This effectively determines the maximum length of the arc along which the text will be drawn. Only applicable to the DynamicDrawTextArc function. Defaults to PI (a semicircle).

radius

radius: number

The radius in pixels of the circle whose arc the text should be drawn along. A smaller radius will result in a greater text curvature and vice versa. Only applicable to the DynamicDrawTextArc function. Defaults to 450px.

strokeColor

strokeColor: string

The stroke color that should be used for the text. Can be any valid CSS color string. Defaults to the same value as the color property.

strokeWidth

strokeWidth: number

The stroke width that should be used when stroking the text. Only used if a strokeColor is defined. Defaults to 1.

textAlign

textAlign: CanvasTextAlign

The text alignment to use. Can be any valid alignment. Not applicable to the DynamicDrawTextArc function. Defaults to "center".

textBaseline

textBaseline: CanvasTextBaseline

The text baseline to use. Can be any valid alignment. Defaults to "middle".

textCurve

textCurve: number

The direction of the curve of the text. This determines whether the center of the text curves upwards (DynamicDrawTextCurve.SMILEY) or downwards (DynamicDrawTextCurve.FROWNY). Only applicable to the DynamicDrawTextArc function. Defaults to DynamicDrawTextCurve.FROWNY.

A drawing callback, used to add drawing effects to dynamic text.

width

width: number

The maximum width of the drawn text. Not applicable to the DynamicDrawTextFromTo function, as constraints are defined by the endpoints. When defined for the DynamicDrawTextArc function, it defines the maximum width of the text perpendicular to the radius line on which the text is centered. Unlimited by default.