ReadablePanelUI ​
UI panel for displaying readable items (books, scrolls, notes, etc.) Features multi-page support with navigation and conditional title display Refactored to extend PanelUI instead of Control
Properties ​
Texture | default_background_texture |
Variables ​
Variant | current_readable_source | null |
Array[String] | pages | [] |
int | current_page | 0 |
Methods ​
void | initialize_ui( p_system_hub: GameHost.SystemHub ) |
void | display_readable_from_data( data: Dictionary ) |
void | display_readable( item: ItemInstance ) |
void | close_panel() |
void | go_to_page( page_index: int ) |
int | get_current_page_number() |
int | get_total_pages() |
bool | is_first_page() |
bool | is_last_page() |
Variant | get_current_source() |
ItemInstance | get_current_item() |
Property descriptions ​
Texture default_background_texture ​
========== READABLE DATA ==========
Variable descriptions ​
Variant current_readable_source = null ​
Can be ItemInstance or InteractableObject
Array[String] pages = [] ​
The pages of the text.
int current_page = 0 ​
The page shown now.
Method descriptions ​
void initialize_ui( p_system_hub: GameHost.SystemHub ) ​
========== INITIALIZATION ==========
void display_readable_from_data( data: Dictionary ) ​
Display readable content from a data dictionary Dictionary should contain:
- "title": String (required)
- "pages": Array[String] (required)
- "background_texture": Texture2D (optional)
- "source": Variant (optional - ItemInstance or InteractableObject)
void display_readable( item: ItemInstance ) ​
Display a readable item (backward compatibility) This method is maintained for existing code that uses ItemInstance directly
void close_panel() ​
Close the readable panel - overrides PanelUI's close_panel
void go_to_page( page_index: int ) ​
Go to specific page (0-indexed)
int get_current_page_number() ​
Get current page number (1-indexed for display)
int get_total_pages() ​
Get total number of pages
bool is_first_page() ​
Check if currently on first page
bool is_last_page() ​
Check if currently on last page
Variant get_current_source() ​
Get the current readable source (can be ItemInstance, InteractableObject, or null)
ItemInstance get_current_item() ​
Get the current readable item (backward compatibility - only returns if source is ItemInstance)