Skip to main content

The "sys_text_init" Function

Syntax#

sys_text_init(entity, index, text, name, linebreak, lineheight, font, col1, col2, col3, col4, shadow, outline, speed);
ArgumentTypeDescription
entityintegerThe data structure of the text entity to process
indexintegerThe index of the row containing the target entity
textstringThe text string to process
namestringThe speaker name associated with the text, for style inheritance
linebreakrealThe width in pixels before text is wrapped into a new line
lineheightrealThe distance between lines of text, as a multiplier of the height of one line
fontfontThe font to process text in, where fnt_default is default
col1colorThe text top-left gradient color, where c_white is default
col2colorThe text top-right gradient color, where c_white is default
col3colorThe text bottom-right gradient color, where c_white is default
col4colorThe text bottom-left gradient color, where c_white is default
shadowcolor/macroThe text shadow color, where 'none' is default
outlinecolor/macroThe text outline color, where 'none' is default
speed/eventrealThe rate at which text is printed onto the screen, as a value of characters per-second

Description#

Processes a string of text for markup and calculates dimensions on initialization. Also returns the final surface created for further processing. This script does not handle style inheritance, which must be processed externally beforehand and the final results passed into this script.

As this script is run automatically by any actions that require processing text, it is almost never necessary to run sys_text_init manually.