Game (functions)/Camera & Scene Control: Difference between revisions
From PMDOWiki
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..." |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
== | == FadeOut == | ||
Fade out the screen. Waits to complete before continuing. {{FuncUsage|nmspace=GAME|nm=FadeOut|args=isWhite, Integer}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=isWhite | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=Fade to white if set to true. Fades to black otherwise. | |||
}} | |||
{{ArgRow | |||
|name=dur | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=The amount of time to fade out in frames. | |||
}} | |||
|} | |||
=== Example === | === Example === | ||
| Line 18: | Line 28: | ||
</pre> | </pre> | ||
== | == FadeIn == | ||
Fade into the screen. Waits to complete before continuing. {{FuncUsage|nmspace=GAME|nm=FadeIn|args=dur}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=dur | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=The amount of time to fade in frames. | |||
}} | |||
|} | |||
=== Example === | === Example === | ||
<pre> | <pre> | ||
| Line 36: | Line 49: | ||
</pre> | </pre> | ||
== | == MoveCamera == | ||
Centers the camera on a position. {{FuncUsage|nmspace=GAME|nm=MoveCamera|args=x, y, dur, relativeToPlayer}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=x | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=X coordinate of the camera center | |||
}} | |||
{{ArgRow | |||
|name=y | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=Y coordinate of the camera center | |||
}} | |||
{{ArgRow | |||
|name=dur | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=The amount of time it takes to move to the destination | |||
}} | |||
{{ArgRow | |||
|name=relativeToPlayer | |||
|type=Boolean | |||
|techt=System.Boolean | |||
|purp=True to have coordinates in relation to player character, false to use the absolute coordinates of the map. | |||
}} | |||
|} | |||
=== Example === | === Example === | ||
| Line 57: | Line 90: | ||
</pre> | </pre> | ||
== | == 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. {{FuncUsage|nmspace=GAME|nm=MoveCameraToChara|args=x, y, dur, chara}} | |||
=== Arguments === | === Arguments === | ||
{| class="wikitable" | |||
{{ArgHeader}} | |||
{{ArgRow | |||
|name=x | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=X coordinate of the camera center, as an offset for the character | |||
}} | |||
{{ArgRow | |||
|name=y | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=Y coordinate of the camera center, as an offset for the character | |||
}} | |||
{{ArgRow | |||
|name=dur | |||
|type=Integer | |||
|techt=System.Integer | |||
|purp=The amount of time it takes to move to the destination | |||
}} | |||
{{ArgRow | |||
|name=chara | |||
|type=Ground Character | |||
|techt=? | |||
|purp=The character to center on it. | |||
}} | |||
|} | |||
=== Example === | === Example === | ||
| Line 80: | Line 131: | ||
</pre> | </pre> | ||
== | == GetCameraCenter == | ||
Gets the current center of the camera. | Gets the current center of the camera. | ||
=== Returns === | === Returns === | ||
| Line 90: | Line 139: | ||
A Loc object representing the center of the camera. | A Loc object representing the center of the camera. | ||
== | == IsCameraOnChar == | ||
Determines whether the camera is centered relative to the player. | Determines whether the camera is centered relative to the player. | ||
=== Returns === | === Returns === | ||
Returns true if the camera is relative to the player, false otherwise. | Returns true if the camera is relative to the player, false otherwise. | ||
Latest revision as of 21:59, 17 January 2026
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.
