PowerQuest 0.18.9
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) 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...
 

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.

◆ 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.