ESCCamera

Extends: Camera2D

Description

Camera handling

Method Descriptions

register

func register(room = null)

Register this camera with the object manager. We do it out here so we can work with the camera before it’s made active as part of the current scene tree.

Parameters

  • room: The room with which to register the camera.

set_limits

func set_limits(limits: ESCCameraLimits)

Sets camera limits so it doesn’t go out of the scene

Parameters

  • limits: The limits to set

set_drag_margin_enabled

func set_drag_margin_enabled(p_dm_h_enabled, p_dm_v_enabled)

set_target

func set_target(p_target, p_time: float = 0)

Set the target for the camera

Parameters

  • p_target: Object to target

  • p_time: Number of seconds for the camera to reach the target

set_camera_zoom

func set_camera_zoom(p_zoom_level: float, p_time: float)

Set the camera zoom level

Parameters

  • p_zoom_level: Zoom level to set

  • p_time: Number of seconds for the camera to reach the zoom level

push

func push(p_target, p_time: float = 0, p_type: int = 0)

Push the camera towards the target in terms of position and zoom level using a given transition type and time. See https://docs.godotengine.org/en/stable/classes/class_tween.html#enumerations

Parameters

  • p_target: Target to push to

  • p_time: Number of seconds for the transition to take

  • p_type: Tween transition type

shift

func shift(p_target: Vector2, p_time: float, p_type: int)

Shift the camera by the given vector in a given time and using a specific Tween transition type.

See https://docs.godotengine.org/en/stable/classes/class_tween.html#enumerations

Parameters

  • p_target: Vector to shift the camera by

  • p_time: Number of seconds for the transition to take

  • p_type: Tween transition type