![]() |
PowerQuest 0.18.12
|
Camera: contains functions and data for manipulating the game camera - Interface to QuestCamera
Camera.SetZoom(2,0.5f); Camera.SetPositionOverride( Points.Volcano, 2 ); Camera.Shake(5,2,1); Dave: The volcano's erupting! ... Camera.ResetPositionOverride(2); Camera.ResetZoom(2);
Properties | |
bool | Enabled [get, set] |
Sets whether PowerQuest controls the camera, set to false if you want to control the camera yourself (eg. animate it) More... | |
bool | IgnoreBounds [get, set] |
Sets whether overrides to camera position ignore room bounds. Useful for snapping camera to stuff off to the side of the room in cutscenes. More... | |
float | Zoom [get, set] |
Gets or sets the camera zoom (mulitplier on default/room vertical height). Use SetZoom() if you want to set a transition time. More... | |
Vector2 | Position [get, set] |
Returns the actual position of the camera. Use SetPositionOverride() to set a transition time. More... | |
Public Member Functions | |
QuestCameraComponent | GetInstance () |
Returns the camera's game object component. More... | |
ICharacter | GetCharacterToFollow () |
Returns the index of the character that the camera is following. More... | |
void | SetCharacterToFollow (ICharacter character, float overTime=0) |
Sets which character the camera will follow, with option to transition over specified time. More... | |
Vector2 | GetPositionOverride () |
Gets the current position override coords as a vector. More... | |
bool | GetHasPositionOverride () |
Returns true if the camera has a position override. More... | |
bool | GetHasPositionOverrideOrTransition () |
Returns true if the camera's position is overriden, or if it's still transitioning back to the player. More... | |
bool | GetTransitioning () |
void | SetPositionOverride (float x, float y=0, float transitionTime=0) |
Overrides the camera position with a specific X,Y. Optionally, transitions to the new position over time. More... | |
void | SetPositionOverride (Vector2 positionOverride, float transitionTime=0) |
Overrides the camera position with a specific Vector. Optionally, transitions to the new position over time. More... | |
void | ResetPositionOverride (float transitionTime=0) |
Resets any position override, returning to folling the current camera, optionally transitions over time. More... | |
float | GetZoom () |
Gets the current camera zoom (mulitplier on default/room vertical height) More... | |
bool | GetHasZoom () |
Returns true if the camera has a zoom override. More... | |
bool | GetHasZoomOrTransition () |
Returns true if the camera's zoom is overriden, or if it's still transitioning back to default. More... | |
void | SetZoom (float zoom, float transitionTime=0) |
Sets a camera zoom (mulitplier on default/room vertical height) More... | |
void | ResetZoom (float transitionTime=0) |
Removes any zoom override, returning to the default/room vertical height. More... | |
Vector2 | GetPosition () |
Returns the current position of the camera. More... | |
void | Snap () |
Snaps the camera to it's target position. Use to cancel the camera from smoothly transitioning to the player position. More... | |
void | Shake (float intensity=1.0f, float duration=0.1f, float falloff=0.15f) |
Shake the camera with the specified intensity, duration and falloff. More... | |
void | Shake (CameraShakeData data) |
Shake the camera with the specified data. More... | |
|
getset |
Sets whether PowerQuest controls the camera, set to false if you want to control the camera yourself (eg. animate it)
|
getset |
Sets whether overrides to camera position ignore room bounds. Useful for snapping camera to stuff off to the side of the room in cutscenes.
|
getset |
Gets or sets the camera zoom (mulitplier on default/room vertical height). Use SetZoom()
if you want to set a transition time.
|
getset |
Returns the actual position of the camera. Use SetPositionOverride()
to set a transition time.
QuestCameraComponent GetInstance | ( | ) |
Returns the camera's game object component.
ICharacter GetCharacterToFollow | ( | ) |
Returns the index of the character that the camera is following.
void SetCharacterToFollow | ( | ICharacter | character, |
float | overTime = 0 |
||
) |
Sets which character the camera will follow, with option to transition over specified time.
Vector2 GetPositionOverride | ( | ) |
Gets the current position override coords as a vector.
bool GetHasPositionOverride | ( | ) |
Returns true if the camera has a position override.
bool GetHasPositionOverrideOrTransition | ( | ) |
Returns true if the camera's position is overriden, or if it's still transitioning back to the player.
void SetPositionOverride | ( | float | x, |
float | y = 0 , |
||
float | transitionTime = 0 |
||
) |
Overrides the camera position with a specific X,Y. Optionally, transitions to the new position over time.
void SetPositionOverride | ( | Vector2 | positionOverride, |
float | transitionTime = 0 |
||
) |
Overrides the camera position with a specific Vector. Optionally, transitions to the new position over time.
void ResetPositionOverride | ( | float | transitionTime = 0 | ) |
Resets any position override, returning to folling the current camera, optionally transitions over time.
float GetZoom | ( | ) |
Gets the current camera zoom (mulitplier on default/room vertical height)
bool GetHasZoom | ( | ) |
Returns true if the camera has a zoom override.
bool GetHasZoomOrTransition | ( | ) |
Returns true if the camera's zoom is overriden, or if it's still transitioning back to default.
void SetZoom | ( | float | zoom, |
float | transitionTime = 0 |
||
) |
Sets a camera zoom (mulitplier on default/room vertical height)
void ResetZoom | ( | float | transitionTime = 0 | ) |
Removes any zoom override, returning to the default/room vertical height.
Vector2 GetPosition | ( | ) |
Returns the current position of the camera.
void Snap | ( | ) |
Snaps the camera to it's target position. Use to cancel the camera from smoothly transitioning to the player position.
void Shake | ( | float | intensity = 1.0f , |
float | duration = 0.1f , |
||
float | falloff = 0.15f |
||
) |
Shake the camera with the specified intensity, duration and falloff.
intensity | Intensity- The strength to shake the camera (in pixels/game units). |
duration | Duration- How long to shake camera at full intensity. |
falloff | Falloff- How long in seconds it takes for camera to go from full intensity to zero. |
void Shake | ( | CameraShakeData | data | ) |
Shake the camera with the specified data.