PowerQuest 0.19.0
Loading...
Searching...
No Matches
ICamera Interface Reference

Detailed Description

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.
 

Property Documentation

◆ Enabled

bool Enabled
getset

Sets whether PowerQuest controls the camera, set to false if you want to control the camera yourself (eg. animate it)

◆ IgnoreBounds

bool IgnoreBounds
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.

◆ Zoom

float Zoom
getset

Gets or sets the camera zoom (mulitplier on default/room vertical height). Use SetZoom() if you want to set a transition time.

See also
SetZoom()
ResetZoom
GetHasZoom()

◆ Position

Vector2 Position
getset

Returns the actual position of the camera. Use SetPositionOverride() to set a transition time.

See also
ResetPositionOverride()

Member Function Documentation

◆ GetInstance()

QuestCameraComponent GetInstance ( )

Returns the camera's game object component.

◆ GetCharacterToFollow()

ICharacter GetCharacterToFollow ( )

Returns the index of the character that the camera is following.

◆ SetCharacterToFollow()

void SetCharacterToFollow ( ICharacter character,
float overTime = 0 )

Sets which character the camera will follow, with option to transition over specified time.

◆ GetPositionOverride()

Vector2 GetPositionOverride ( )

Gets the current position override coords as a vector.

◆ GetHasPositionOverride()

bool GetHasPositionOverride ( )

Returns true if the camera has a position override.

◆ GetHasPositionOverrideOrTransition()

bool GetHasPositionOverrideOrTransition ( )

Returns true if the camera's position is overriden, or if it's still transitioning back to the player.

◆ GetTransitioning()

bool GetTransitioning ( )

Returns true if transitioning to/from position override or zoom.

◆ SetPositionOverride() [1/2]

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.

◆ SetPositionOverride() [2/2]

void SetPositionOverride ( Vector2 positionOverride,
float transitionTime = 0 )

Overrides the camera position with a specific Vector. Optionally, transitions to the new position over time.

◆ ResetPositionOverride()

void ResetPositionOverride ( float transitionTime = 0)

Resets any position override, returning to folling the current camera, optionally transitions over time.

◆ GetZoom()

float GetZoom ( )

Gets the current camera zoom (mulitplier on default/room vertical height)

◆ GetHasZoom()

bool GetHasZoom ( )

Returns true if the camera has a zoom override.

◆ GetHasZoomOrTransition()

bool GetHasZoomOrTransition ( )

Returns true if the camera's zoom is overriden, or if it's still transitioning back to default.

◆ SetZoom()

void SetZoom ( float zoom,
float transitionTime = 0 )

Sets a camera zoom (mulitplier on default/room vertical height)

See also
ResetZoom
Zoom
GetHasZoom

◆ ResetZoom()

void ResetZoom ( float transitionTime = 0)

Removes any zoom override, returning to the default/room vertical height.

◆ GetPosition()

Vector2 GetPosition ( )

Returns the current position of the camera.

◆ Snap()

void Snap ( )

Snaps the camera to it's target position. Use to cancel the camera from smoothly transitioning to the player position.

◆ Shake() [1/2]

void Shake ( float intensity = 1.0f,
float duration = 0.1f,
float falloff = 0.15f )

Shake the camera with the specified intensity, duration and falloff.

Parameters
intensityIntensity- The strength to shake the camera (in pixels/game units).
durationDuration- How long to shake camera at full intensity.
falloffFalloff- How long in seconds it takes for camera to go from full intensity to zero.

◆ Shake() [2/2]

void Shake ( CameraShakeData data)

Shake the camera with the specified data.