ESCRoomManager

Extends: Resource

Description

A manager for rooms in a game.

Constants

GLOBAL_LAST_SCENE

const GLOBAL_LAST_SCENE = "ESC_LAST_SCENE"

Reserved global containing the global_id of previous room. Cannot be overriden.

GLOBAL_FORCE_LAST_SCENE_NULL

const GLOBAL_FORCE_LAST_SCENE_NULL = "FORCE_LAST_SCENE_NULL"

Reserved global name determining whether ESC_LAST_SCENE is considered for automatic transitions.

GLOBAL_ANIMATION_RESOURCES

const GLOBAL_ANIMATION_RESOURCES = "ANIMATION_RESOURCES"

Reserved global name containing the animations

GLOBAL_CURRENT_SCENE

const GLOBAL_CURRENT_SCENE = "ESC_CURRENT_SCENE"

Reserved global name containing the global_id of the current room

CAMERA_SCENE_PATH

const CAMERA_SCENE_PATH = "res://addons/escoria-core/game/scenes/camera_player/camera.tscn"

Path to escoria-core camera scene

RESERVED_GLOBALS

const RESERVED_GLOBALS = {"ANIMATION_RESOURCES": {}, "ESC_CURRENT_SCENE": "", "ESC_LAST_SCENE": "", "FORCE_LAST_SCENE_NULL": false}

Dictionary of the reserved globals to register and their initial values.

Members

Methods


register_reserved_globals

func register_reserved_globals() -> void

Registers all reserved global flags for use.

Parameters

None.

Returns

Returns nothing.


change_scene_to_file

func change_scene_to_file(room_path: String, enable_automatic_transitions: bool) -> void

Performs the actions needed in order to change the current scene to the one specified by room_path.

Parameters

Name

Type

Description

Required?

room_path

String

Node path to the room that is to become the new current room.

yes

enable_automatic_transitions

bool

Whether to play the transition between rooms automatically or to leave the responsibility to the developer.

yes

Returns

Returns nothing.


change_scene_to_godot_file

func change_scene_to_godot_file(room_path: String) -> void

Changes the current scene to a NON-ESCORIA room scene. This allows to use full-Godot scenes in the game, but requires to call Escoria functions from GDScript to change back to an Escoria room.

Parameters

Name

Type

Description

Required?

room_path

String

Node path to the scene to change to

yes

Returns

Returns nothing.


init_room

func init_room(room: ESCRoom) -> void

Sanitize camera limits, add player node and set the global id to the name of this node if it’s not set manually.

Parameters

Name

Type

Description

Required?

room

ESCRoom

The ESCRoom to be initialized for use.

yes

Returns

Returns nothing.