Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • Camera

Index

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
  • get following(): boolean
  • Whether the camera is following a target or not.

    Returns boolean

Methods

  • disable_shake(): void
  • enable_shake(unfollow_hero_on_shake?: boolean): void
  • 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: ControllableChar | InteractableObjects

      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.

  • reset_lerp(): void
  • update(): void

Generated using TypeDoc