The source code and sample for GODOT UI control to display single-paragraph text, recognize on-screen words locations and interact (hit-testing) individual words.
- Automatically generate rectangle for each word to be used for hit-testing.
- Allows specifying distinct color for each word or character range.
- Supports aligning the text horizontally or vertically within control area.
- Supports line spacing.
- Right-to-left direction is supported.
Shows how to setup an InteractParagraph in the editor, and how to interact with individual words at run-time.
.get_word_rect_at(pos: Vector2)-> WordRectInfo
.set_word_rect_color(wordRect: WordRectInfo, color: Color)-> void:
.set_color_range(start: int, end: int, color: Color)-> void: