Game (functions)/Camera
This page documents the ScriptGame class for Lua scripting.
As a singleton class, it can be accessed from Lua with GAME.
FadeOutFront
GAME:FadeOutFront(white, duration)
Fade out the screen. Waits to complete before continuing.
This fade specifically comes in front of the menu.
Parameters
| Name | Type | Description |
|---|---|---|
| System.Boolean | System.Boolean | Fade to white if set to true. Fades to black otherwise. |
| System.Int32 | System.Int32 | The amount of time to fade in frames. |
Returns
| Type | Description |
|---|---|
| NLua.LuaFunction |
FadeInFront
GAME:FadeInFront(duration)
Fade in the screen. Waits to complete before continuing.
This fade specifically comes in front of the menu.
Parameters
| Name | Type | Description |
|---|---|---|
| System.Int32 | System.Int32 | The amount of time to fade in frames. |
Returns
| Type | Description |
|---|---|
| NLua.LuaFunction |
FadeOut
GAME:FadeOut(white, duration)
Fade out the screen. Waits to complete before continuing.
Parameters
| Name | Type | Description |
|---|---|---|
| System.Boolean | System.Boolean | Fade to white if set to true. Fades to black otherwise. |
| System.Int32 | System.Int32 | The amount of time to fade in frames. |
Returns
| Type | Description |
|---|---|
| NLua.LuaFunction |
FadeIn
GAME:FadeIn(duration)
Fade into the screen. Waits to complete before continuing.
Parameters
| Name | Type | Description |
|---|---|---|
| System.Int32 | System.Int32 | The amount of time to fade in frames. |
Returns
| Type | Description |
|---|---|
| NLua.LuaFunction |
MoveCamera
GAME:MoveCamera(x, y, duration, toPlayer)
Centers the camera on a position.
Parameters
| Name | Type | Description |
|---|---|---|
| System.Int32 | System.Int32 | X coordinate of the camera center |
| System.Int32 | System.Int32 | Y coordinate of the camera center |
| System.Int32 | System.Int32 | The amount of time it takes ot move to the destination |
| System.Boolean | System.Boolean | Destination is in absolute coordinates if false, and relative to the player character if set to true. |
Returns
| Type | Description |
|---|---|
| NLua.LuaFunction |
MoveCameraToChara
GAME:MoveCameraToChara(x, y, duration, chara)
Centers the camera on a character.
As we are simply moving the camera to a character, this will simply set ViewCenter and not ViewOffset.
Parameters
| Name | Type | Description |
|---|---|---|
| System.Int32 | System.Int32 | X coordinate of the camera center, as an offset for the chara |
| System.Int32 | System.Int32 | Y coordinate of the camera center, as an offset for the chara |
| System.Int32 | System.Int32 | The amount of time it takes ot move to the destination |
| RogueEssence.Ground.GroundChar | RogueEssence.Ground.GroundChar | The character to center on. |
Returns
| Type | Description |
|---|---|
| NLua.LuaFunction |
GetCameraCenter
GAME:GetCameraCenter()
Gets the current center of the camera.
Returns
| Type | Description |
|---|---|
| RogueElements.Loc | A Loc object representing the center of the camera. |
IsCameraOnChar
GAME:IsCameraOnChar()
Determines whether the camera is centered relative to the player.
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if the camera is relative to the player, false otherwise. |
References
https://github.com/RogueCollab/RogueEssence/blob/master/RogueEssence/Lua/ScriptGameCamera.cs
