![]() |
PowerQuest 0.19.4
|
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) | |
| 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. | |
| 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. | |
| Vector2 | Position [get, set] |
Returns the actual position of the camera. Use SetPositionOverride() to set a transition time. | |
Public Member Functions | |
| 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. | |
| bool | GetTransitioning () |
| Returns true if transitioning to/from position override or zoom. | |
| 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. | |
| void | Shake (CameraShakeData data) |
| Shake the camera with the specified data. | |
|
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.
| bool GetTransitioning | ( | ) |
Returns true if transitioning to/from position override or zoom.
| 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.