- Title: Juju's Text Engine v3 "Fancy Pants"
- Description: A comprehensive text-drawing system allowing for character-by-character display, human-readable formatting, and autosizing to text box widths
- GM Version: GMS
- File type: .gmz
- File size: 110kb
- File link: Click Me
- Required Extensions: None
- Required DLLs: None
The only other text engines I could find were either a decade old, used rigid non-human-readable formatting, were designed around re-parsing text every frame, or relied upon a number of legacy functions that are no longer support in GM:S. So I made my own! All the features are turn-offable so it's deployable for a lot of situations.
This example is left as pure, simple text drawing. This isn't a dialogue engine, simply a robust method that takes input and plonks it on the screen. Since it makes no assumptions about use, this is an easy script to implement. Text is drawn to the screen by calling a single script (scr_juju_text) that pre-parses the input string and creates a container instance that handles drawing. This instance, when destroyed, also cleans up the data structures created by the parsing process. It's all encapsulated and neat and tidy.
At the moment, formatting is limited to font and colours. As a developer, you can add new definitions for tags by editing the contents of scr_juju_text_formatting. Inside is a simple switch statement with a bunch of presets that should help guide you in creating new styles. Quick word on alignment - the scripts assume you'll be using the GM standard text alignment of top and left. I may add alignment features if there's demand.
Edited by Juju, 10 December 2015 - 01:53 AM.