TextState


A class representing the current state of the text, used for processing modifiers and drawing the text.


Fields


TextState.color: number, [2]? }

The current color of the text.


TextState.current_line: integer

The current line number of the text being processed.


TextState.current_node: integer

The index of the current node being processed in the text.


TextState.current_x: number

The current X position of the text cursor.


TextState.current_y: number

The current Y position of the text cursor.


TextState.escaping: boolean

Whether the text is currently escaping a character (i.e. the last character was a backslash, so the next character should be treated as a normal character even if it's normally a modifier character).


TextState.font: string

The current font of the text.


TextState.font_size: number?

The current font size of the text, or nil if using the default size for the font.


TextState.indent_length: integer

The length of the current indent, used for auto-indenting wrapped lines.


TextState.indent_mode: boolean

Whether the text is currently in indent mode (i.e. the current line starts with the indent_string).


TextState.indent_string: string

The string to use for indented lines.


TextState.last_shake: number

The last time the shake effect was applied, used to prevent applying the shake effect too frequently.


TextState.line_lengths:

A table mapping line numbers to their lengths in pixels, used for alignment.


TextState.max_height: number

The maximum height of the text, used for auto-sizing.


TextState.max_width: number

The maximum width of the text, used for alignment and auto-sizing.


TextState.newline: boolean

Whether the current node is a newline or not, used to prevent applying certain modifiers to newlines.


TextState.noskip: boolean

Whether the text can be skipped or not.


TextState.offset_x: number

The X offset to apply to the text.


TextState.offset_y: number

The Y offset to apply to the text.


TextState.progress: number

The progress of the text being typed out.


TextState.shake: number

The intensity of the shake effect to apply to the text.


TextState.skipping: boolean

Whether the text is currently being skipped.


TextState.spacing: number

Additional spacing to add between characters when typing out the text.


TextState.speed: number

The speed multiplier for typing out the text.


TextState.style: string

The current style of the text.


TextState.talk_anim: boolean

Whether the text should use the talking animation when being typed out.


TextState.typed_characters: integer

The number of characters that have been typed out so far.


TextState.typed_string: string

The string of characters that have been typed out so far.


TextState.typing: boolean

Whether the text is currently being typed out.


TextState.waiting: number

The amount of time the text should wait before continuing to type out more characters.


TextState.wave_direction: number

The direction of the wave effect to apply to the text, in radians.


TextState.wave_distance: number

The distance of the wave effect to apply to the text.


TextState.wave_offset: number

The offset of the wave effect to apply to the text.


TextState.wave_speed: number

The speed of the wave effect to apply to the text.