Skip to content

ReadablePanelUI ​

Inherits: PanelUI < Control

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 ​

Texturedefault_background_texture

Variables ​

Variantcurrent_readable_sourcenull
Array[String]pages[]
intcurrent_page0

Methods ​

voidinitialize_ui( p_system_hub: GameHost.SystemHub )
voiddisplay_readable_from_data( data: Dictionary )
voiddisplay_readable( item: ItemInstance )
voidclose_panel()
voidgo_to_page( page_index: int )
intget_current_page_number()
intget_total_pages()
boolis_first_page()
boolis_last_page()
Variantget_current_source()
ItemInstanceget_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)