Game (functions)/Camera & Scene Control

From PMDOWiki
Revision as of 21:00, 17 January 2026 by Imbion (talk | contribs) (Created page with "== GAME:FadeOut == Fade out the screen. Waits to complete before continuing. === Arguments === * <code>white</code>: Fade to white if set to true. Fades to black otherwise. * <code>duration</code>: The amount of time to fade in frames. === Example === <pre> GAME:FadeOut(false, 60) </pre> == GAME:FadeIn == Fade into the screen. Waits to complete before continuing. === Arguments === * <code>duration</code>: The amount of time to fade in frames. === Example...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GAME:FadeOut

Fade out the screen. Waits to complete before continuing.


Arguments

  • white: Fade to white if set to true. Fades to black otherwise.
  • duration: The amount of time to fade in frames.

Example


GAME:FadeOut(false, 60)

GAME:FadeIn

Fade into the screen. Waits to complete before continuing.


Arguments

  • duration: The amount of time to fade in frames.

Example


GAME:FadeIn(60)

GAME:MoveCamera

Centers the camera on a position.


Arguments

  • x: X coordinate of the camera center
  • y: Y coordinate of the camera center
  • duration: The amount of time it takes ot move to the destination
  • toPlayer: Destination is in absolute coordinates if false, and relative to the player character if set to true.

Example


GAME:MoveCamera(200, 240, 60, false)

GAME:MoveCameraToChara

Centers the camera on a character.

As we are simply moving the camera to a character, this will simply set ViewCenter and not ViewOffset.


Arguments

  • x: X coordinate of the camera center, as an offset for the chara
  • y: Y coordinate of the camera center, as an offset for the chara
  • duration: The amount of time it takes ot move to the destination
  • chara: The character to center on.

Example


GAME:MoveCameraToChara(200, 240, 60, false)

GAME:GetCameraCenter

Gets the current center of the camera.


Returns

A Loc object representing the center of the camera.

GAME:IsCameraOnChar

Determines whether the camera is centered relative to the player.


Returns

Returns true if the camera is relative to the player, false otherwise.