PopochiuIGraphicInterface
Inherits: Node
Description
Provides access to the in-game PopochiuGraphicInterface via the singleton G
(for example: G.block()).
Use this interface to manage the GUI.
Capabilities include:
-
Showing messages at the center of the screen (narration or system messages).
-
Displaying hover info for objects under the cursor.
-
Showing, hiding, blocking or unblocking the GUI.
Use examples:
# Shows an instructional tooltip
G.show_info('Click this to open the main menu')
# Displays a message box in the center of the screen
# and wait for the player to dismiss it
G.display('There are no actions set for this object')
# Hides the interface (for example during a cutscene
# or when showing a full-screen close-up)
G.hide_interface()
# Connect a function to a specific GUI event
G.connect('inventory_shown', self, '_play_inventory_sfx')
Properties
| Type | Name | Default |
|---|---|---|
| PopochiuGraphicInterface | gui | |
| Variant | is_blocked | false |
| Variant | template | "" |
Methods
| Return Type | Method |
|---|---|
| void | block() |
| String | get_cursor_name() |
| void | hide_interface() |
| Callable | queue_hide_interface() |
| Callable | queue_show_interface() |
| Callable | queue_show_system_text(msg: String) |
| void | show_hover_text(msg = '') |
| void | show_interface() |
| void | show_system_text(msg: String) |
| void | unblock(wait = false) |
Signals
- blocked()
- dialog_line_finished()
- dialog_line_started()
- dialog_options_shown()
- hidden()
- hover_text_shown(message: String)
- load_feedback_finished()
- mouse_entered_clickable(clickable: PopochiuClickable)
- mouse_entered_inventory_item(inventory_item: PopochiuInventoryItem)
- mouse_exited_clickable(clickable: PopochiuClickable)
- mouse_exited_inventory_item(inventory_item: PopochiuInventoryItem)
- popup_requested(script_name: StringName)
- shown()
- system_text_hidden()
- system_text_shown(message: String)
- unblocked()
Signal Descriptions
blocked
signal blocked()
Emitted when block() is called; PopochiuGraphicInterface (the in-game GUI)
listens to this to block input.
dialog_line_finished
signal dialog_line_finished()
Emitted when a PopochiuCharacter finishes speaking a dialog line.
dialog_line_started
signal dialog_line_started()
Emitted when a PopochiuCharacter begins speaking a dialog line.
dialog_options_shown
signal dialog_options_shown()
Emitted when the dialog options for the running PopochiuDialog are shown.
hidden
signal hidden()
Emitted when hide_interface() is called; PopochiuGraphicInterface (the in-game GUI)
listens to this to hide the GUI.
hover_text_shown
signal hover_text_shown(message: String)
Emitted when show_hover_text() is called so the GUI can display message
as a hover text.
load_feedback_finished
signal load_feedback_finished()
Emitted after a game is loaded and the GUI has finished showing any notification.
mouse_entered_clickable
signal mouse_entered_clickable(clickable: PopochiuClickable)
Emitted when the cursor enters (hovers) a clickable.
mouse_entered_inventory_item
signal mouse_entered_inventory_item(inventory_item: PopochiuInventoryItem)
Emitted when the cursor enters (hovers) an inventory_item.
mouse_exited_clickable
signal mouse_exited_clickable(clickable: PopochiuClickable)
Emitted when the cursor exits a clickable.
mouse_exited_inventory_item
signal mouse_exited_inventory_item(inventory_item: PopochiuInventoryItem)
Emitted when the cursor exits an inventory_item.
popup_requested
signal popup_requested(script_name: StringName)
Emitted when a PopochiuPopup identified by script_name is requested.
shown
signal shown()
Emitted when show_interface() is called; PopochiuGraphicInterface (the in-game GUI)
listens to this to show the GUI.
system_text_hidden
signal system_text_hidden()
Emitted when the system text is dismissed by a click.
system_text_shown
signal system_text_shown(message: String)
Emitted when show_system_text() is called so the GUI can display message
as a system text.
unblocked
signal unblocked()
Emitted when unblock() is called; PopochiuGraphicInterface (the in-game GUI)
listens to this to resume input.
Property Descriptions
gui
var gui : PopochiuGraphicInterface
Reference to the active PopochiuGraphicInterface instance for the chosen template.
is_blocked
var is_blocked = false
Whether the GUI is currently blocked.
template
var template = ""
Identifier of the GUI template used by the game.
Method Descriptions
block
func block() -> void
Blocks the in-game GUI, preventing player interaction.
get_cursor_name
func get_cursor_name() -> String
Returns the name of the cursor texture that the GUI requests to show.
hide_interface
func hide_interface() -> void
Hides the in-game GUI.
queue_hide_interface
func queue_hide_interface() -> Callable
Hides the in-game GUI.
This method is intended to be used inside a queue() of instructions.
queue_show_interface
func queue_show_interface() -> Callable
Shows the in-game GUI.
This method is intended to be used inside a queue() of instructions.
queue_show_system_text
func queue_show_system_text(msg: String) -> Callable
Displays msg in a box centered on-screen (narration/instruction/warning).
Temporarily blocks the GUI until the player clicks anywhere to dismiss the message.
This method is intended to be used inside a queue() of instructions.
show_hover_text
func show_hover_text(msg = '') -> void
Shows msg as hover text for the currently hovered object. Does not block interactions.
Can be used to inform the player what happens when clicking or right-clicking an object.
show_interface
func show_interface() -> void
Shows the in-game GUI.
show_system_text
func show_system_text(msg: String) -> void
Displays msg in a box centered on-screen (narration/instruction/warning).
Temporarily blocks the GUI until the player clicks anywhere to dismiss the message.
unblock
func unblock(wait = false) -> void
Unblocks the in-game GUI.
The wait parameter is used for internal purposes to avoid race conditions
in specific scenarios. Ignore it unless you know what you're doing.