PowerQuest
ICamera Interface Reference

Detailed Description

Camera: contains functions and data for manipulating the game camera - Interface to QuestCamera.

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

Public Member Functions

QuestCameraComponent GetInstance ()
 Returns the camera's game object component. More...
 
ICharacter GetCharacterToFollow ()
 Returns the index of teh character that the camera is following. More...
 
void SetCharacterToFollow (ICharacter character)
 Sets which character the camera will follow. 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...
 
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...
 
void SetZoom (float zoom)
 Sets a camera zoom (mulitplier on default/room vertical height) More...
 
void ResetZoom ()
 Removes any zoom override, returning to the default/room vertical height. More...
 
Vector2 GetPosition ()
 Returns the actual position of the camera. More...
 
void Shake (float intensity, float duration=0.0f, 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.

Member Function Documentation

◆ GetInstance()

QuestCameraComponent GetInstance ( )

Returns the camera's game object component.

◆ GetCharacterToFollow()

ICharacter GetCharacterToFollow ( )

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

◆ SetCharacterToFollow()

void SetCharacterToFollow ( ICharacter  character)

Sets which character the camera will follow.

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

◆ SetZoom()

void SetZoom ( float  zoom)

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

◆ ResetZoom()

void ResetZoom ( )

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

◆ GetPosition()

Vector2 GetPosition ( )

Returns the actual position of the camera.

◆ Shake() [1/2]

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

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

Parameters
intensityIntensity- The strength to shake the camera (in pixels).
durationDuration- How long to shake camera at full intensity.
falloffFalloff- How long 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.