A helper class to manage Phaser.Camera with some utils.

Constructors

Properties

_camera_shake_enable: boolean
_following: boolean
_shake_ref_pos: {
    x: number;
    y: number;
}

Type declaration

  • x: number
  • y: number
_unfollow_hero_on_shake: boolean
data: GoldenSun
game: Game
CAMERA_LERP: 0.15 = 0.15
SHAKE_INTENSITY: 3 = 3

Accessors

  • get camera_shake_enable(): boolean
  • Whether the camera is shaking or not.

    Returns boolean

  • get following(): boolean
  • Whether the camera is following a target or not.

    Returns boolean

Methods

  • Enables camera shake.

    Parameters

    • unfollow_hero_on_shake: boolean = false

      will unfollow the hero while shaking the camera.

    Returns void

  • Enable camera following for a given target.

    Parameters

    • Optional target: InteractableObjects | ControllableChar

      the target for the camera to follow.

    • Optional duration: number

      the duration that the camera will to take to reach target position in ms.

    Returns Promise<void>

    returns a promise to the transition end.

  • Resets camera lerp to engine defaults.

    Returns void