Game (functions)/Camera & Scene Control
From PMDOWiki
FadeOut
Fade out the screen. Waits to complete before continuing. Argument order is GAME:FadeOut(isWhite, Integer).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| isWhite | Boolean | System.Boolean
|
Fade to white if set to true. Fades to black otherwise. |
| dur | Integer | System.Integer
|
The amount of time to fade out in frames. |
Example
GAME:FadeOut(false, 60)
FadeIn
Fade into the screen. Waits to complete before continuing. Argument order is GAME:FadeIn(dur).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| dur | Integer | System.Integer
|
The amount of time to fade in frames. |
Example
GAME:FadeIn(60)
MoveCamera
Centers the camera on a position. Argument order is GAME:MoveCamera(x, y, dur, relativeToPlayer).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| x | Integer | System.Integer
|
X coordinate of the camera center |
| y | Integer | System.Integer
|
Y coordinate of the camera center |
| dur | Integer | System.Integer
|
The amount of time it takes to move to the destination |
| relativeToPlayer | Boolean | System.Boolean
|
True to have coordinates in relation to player character, false to use the absolute coordinates of the map. |
Example
GAME:MoveCamera(200, 240, 60, false)
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. Argument order is GAME:MoveCameraToChara(x, y, dur, chara).
Arguments
| Name | Type | Technical Type | Purpose |
|---|---|---|---|
| x | Integer | System.Integer
|
X coordinate of the camera center, as an offset for the character |
| y | Integer | System.Integer
|
Y coordinate of the camera center, as an offset for the character |
| dur | Integer | System.Integer
|
The amount of time it takes to move to the destination |
| chara | Ground Character | ?
|
The character to center on it. |
Example
GAME:MoveCameraToChara(200, 240, 60, false)
GetCameraCenter
Gets the current center of the camera.
Returns
A Loc object representing the center of the camera.
IsCameraOnChar
Determines whether the camera is centered relative to the player.
Returns
Returns true if the camera is relative to the player, false otherwise.
