ReadableInteraction ​
Inherits: InteractableObjectInteraction < Interaction < Resource
Readable interaction - displays multi-page text content in UI panel Used for signs, books, plaques, notes, etc.
Properties ​
Array[String] | pages_text | [] |
String | readable_title | "": |
Texture2D | background_texture |
Methods ​
void | setup_for_interactable_objects( interactable: InteractableObject ) |
bool | can_interact( player: Player ) |
void | start_interaction( player: Player ) |
void | end_interaction() |
String | get_interaction_prompt() |
void | add_page( page_text: String ) |
bool | remove_page( index: int ) |
void | clear_pages() |
int | get_page_count() |
String | get_page_text( index: int ) |
bool | set_page_text( index: int, text: String ) |
bool | has_content() |
Dictionary | save_state() |
void | load_state( state: Dictionary ) |
void | cleanup() |
Property descriptions ​
Array[String] pages_text = [] ​
Array of text content for each page Each string represents one page - supports BBCode rich text formatting Example: ["Page 1 content...", "Page 2 content...", "Final page..."]
String readable_title = "": ​
Optional title for the readable content (displayed in UI header)
Texture2D background_texture ​
Optional background texture for the readable panel
Method descriptions ​
void setup_for_interactable_objects( interactable: InteractableObject ) ​
Sets the readable up on its object.
bool can_interact( player: Player ) ​
Can the player read it now?
void start_interaction( player: Player ) ​
Opens the reading window with the pages.
void end_interaction() ​
Does nothing: the reading window closes itself.
String get_interaction_prompt() ​
The text of the prompt above the object ("Read", or "Empty" when it has no pages).
void add_page( page_text: String ) ​
Add a page to the readable content
bool remove_page( index: int ) ​
Remove a page by index
void clear_pages() ​
Clear all pages
int get_page_count() ​
Get page count
String get_page_text( index: int ) ​
Get specific page text
bool set_page_text( index: int, text: String ) ​
Set specific page text
bool has_content() ​
Check if has any content
Dictionary save_state() ​
The pages and the title for a save.
void load_state( state: Dictionary ) ​
Restores the pages and the title from a save.
void cleanup() ​
Does nothing: it has no timers.