ESCGame

Extends: Node2D

Description

A base class for ESC game scenes An extending class can be used in the project settings and is responsible for managing very basic game features and controls

Enumerations

EDITOR_GAME_DEBUG_DISPLAY

const EDITOR_GAME_DEBUG_DISPLAY: Dictionary = {"MOUSE_TOOLTIP_LIMITS":1,"NONE":0}

Editor debug modes NONE - No debugging MOUSE_TOOLTIP_LIMITS - Visualize the tooltip limits

Property Descriptions

pause_menu

export var pause_menu = ""

The main menu node

mouse_tooltip_margin

export var mouse_tooltip_margin = 50

The safe margin around tooltips

editor_debug_mode

export var editor_debug_mode = 0

Which (if any) debug mode for the editor is used

ui_parent_control_node

export var ui_parent_control_node = ""

The Control node underneath which all UI must be placed. This should be a Control node and NOT a CanvasLayer (or any other type of) node.

tooltip_node

var tooltip_node: Object

A reference to the node handling tooltips

room_ready_for_inputs

var room_ready_for_inputs: bool = false

Boolean indicating whether the game scene is ready to accept inputs from the player. This enables using escoria.is_ready_for_inputs() in _input() function of game.gd script.

Method Descriptions

do_walk

func do_walk(destination, params: Array, can_interrupt: bool = false) -> void

Sets up and performs default walking action

Parameters

  • destination: Destination to walk to

  • params: Parameters for the action

  • can_interrupt: if true, this command will interrupt any ongoing event

left_click_on_bg

func left_click_on_bg(position: Vector2) -> void

Called when the player left clicks on the background (Needs to be overridden, if supported)

Parameters

  • position: Position clicked

right_click_on_bg

func right_click_on_bg(position: Vector2) -> void

Called when the player right clicks on the background (Needs to be overridden, if supported)

Parameters

  • position: Position clicked

left_double_click_on_bg

func left_double_click_on_bg(position: Vector2) -> void

Called when the player double clicks on the background (Needs to be overridden, if supported)

Parameters

  • position: Position clicked

element_focused

func element_focused(element_id: String) -> void

Called when an element in the scene was focused (Needs to be overridden, if supported)

Parameters

  • element_id: Global id of the element focused

element_unfocused

func element_unfocused() -> void

Called when no element is focused anymore (Needs to be overridden, if supported)

left_click_on_item

func left_click_on_item(item_global_id: String, event: InputEvent) -> void

Called when an item was left clicked (Needs to be overridden, if supported)

Parameters

  • item_global_id: Global id of the item that was clicked

  • event: The received input event

right_click_on_item

func right_click_on_item(item_global_id: String, event: InputEvent) -> void

Called when an item was right clicked (Needs to be overridden, if supported)

Parameters

  • item_global_id: Global id of the item that was clicked

  • event: The received input event

left_double_click_on_item

func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void

left_click_on_inventory_item

func left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void

right_click_on_inventory_item

func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void

left_double_click_on_inventory_item

func left_double_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void

inventory_item_focused

func inventory_item_focused(inventory_item_global_id: String) -> void

Called when an inventory item was focused (Needs to be overridden, if supported)

Parameters

  • inventory_item_global_id: Global id of the inventory item that was focused

inventory_item_unfocused

func inventory_item_unfocused() -> void

Called when no inventory item is focused anymore (Needs to be overridden, if supported)

open_inventory

func open_inventory()

Called when the inventory was opened (Needs to be overridden, if supported)

close_inventory

func close_inventory()

Called when the inventory was closed (Needs to be overridden, if supported)

mousewheel_action

func mousewheel_action(direction: int)

Called when the mousewheel was used (Needs to be overridden, if supported)

Parameter

  • direction: The direction in which the mouse wheel was rotated

hide_ui

func hide_ui()

Called when the UI should be hidden (Needs to be overridden, if supported)

show_ui

func show_ui()

Called when the UI should be shown (Needs to be overridden, if supported)

pause_game

func pause_game()

Pauses the game. Reimplement to eventually show a specific UI.

unpause_game

func unpause_game()

Unpause the game. Reimplement to eventually hide a specific UI.

show_main_menu

func show_main_menu()

Shows the main menu. Reimplement to show a specific UI.

hide_main_menu

func hide_main_menu()

Hides the main menu. Reimplement to hide a specific UI.

apply_custom_settings

func apply_custom_settings(custom_settings: Dictionary)

Custom function that is meant to apply custom settings. Called right after Escoria settings file was loaded.

get_custom_data

func get_custom_data() -> Dictionary

Custom function automatically called when save game is created.

Returns A Dictionary containing the custom data to be saved within the game file.

show_crash_popup

func show_crash_popup(files: Array) -> var

Shows the crash popup when a crash occurs

Parameters

  • files: Array of strings containing the paths to the files generated on crash

escoria_hide_ui

func escoria_hide_ui()

*** FOR USE BY ESCORIA CORE ONLY *** Hides everything under the UI Control node.

escoria_show_ui

func escoria_show_ui()

*** FOR USE BY ESCORIA CORE ONLY *** Show everything under the UI Control node.

Signals

  • signal crash_popup_confirmed(): Emitted when the user has confirmed the crash popup

  • signal request_pause_menu(): Signal sent when pause menu has to be displayed