C# Class Evbpc.Framework.Utilities.Camera

Represents an object that tracks and updates it's position based on another object, and can be used to determine where rendering should take place.
Inheritance: ITrackableObject
Show file Open project: EBrown8534/Framework

Public Methods

Method Description
Camera ( ITrackableObject trackObject, RectangleF triggerBounds ) : Evbpc.Framework.Drawing

Creates a new instance of the Camera class from the specified TrackObject and TriggerBounds.

CenterCamera ( ) : void

This method will immediately move the Camera to center on the ITrackableObject. If you wish to pan smoothly, you should use CenterCamera(float).

This is effectively the same as the CenterCamera(float) method with an value of 0 specified.

CenterCamera ( float animationTime ) : void

This method will smoothly center the Camera to the ITrackableObject.

If a value of 0 is provided for the animationTime, then this has the same effect as the CenterCamera() method.

Contains ( ITrackableObject testObject, bool entirelyContained ) : bool

Determines if the current Camera instances contains the ITrackableObject.

MoveCamera ( Vector2F vector ) : void

Alters the Position of the current Camera instance by the specified Vector2F.

ResizeCamera ( Vector2F adjustment ) : void

Alters the Size of the current Camera instance by the specified Vector2F.

ScaleCamera ( float adjustment ) : void

Alters the Scale of the current Camera instance by the specified value.

SetPosition ( PointF position ) : void

Updates the Position of the current Camera instance to the value specified.

SetScale ( float scale ) : void

Updates the Scale of the current Camera instance to the specified value.

SetSize ( SizeF size ) : void

Updates the Size of the current Camera instance.

Private Methods

Method Description
OnTrackableObjectChanged ( TrackableObjectChangedEventArgs e ) : void
trackObject_TrackableObjectChanged ( object sender, TrackableObjectChangedEventArgs e ) : void

Method Details

Camera() public method

Creates a new instance of the Camera class from the specified TrackObject and TriggerBounds.
public Camera ( ITrackableObject trackObject, RectangleF triggerBounds ) : Evbpc.Framework.Drawing
trackObject ITrackableObject An to follow.
triggerBounds Evbpc.Framework.Drawing.RectangleF A that represents how close to the edge of the screen an must be to trigger panning.
return Evbpc.Framework.Drawing

CenterCamera() public method

This method will immediately move the Camera to center on the ITrackableObject. If you wish to pan smoothly, you should use CenterCamera(float).
This is effectively the same as the CenterCamera(float) method with an value of 0 specified.
public CenterCamera ( ) : void
return void

CenterCamera() public method

This method will smoothly center the Camera to the ITrackableObject.
If a value of 0 is provided for the animationTime, then this has the same effect as the CenterCamera() method.
public CenterCamera ( float animationTime ) : void
animationTime float A value that indicates how long (in seconds) it should take the to center on the . Smaller values will mean a quicker movement, but may also cause jumpy-ness.
return void

Contains() public method

Determines if the current Camera instances contains the ITrackableObject.
public Contains ( ITrackableObject testObject, bool entirelyContained ) : bool
testObject ITrackableObject The to test.
entirelyContained bool If true, will only return true if the testObject is entirely contained in the , otherwise will return true if any part of the testObject is contained.
return bool

MoveCamera() public method

Alters the Position of the current Camera instance by the specified Vector2F.
public MoveCamera ( Vector2F vector ) : void
vector Vector2F The distance to move the .
return void

ResizeCamera() public method

Alters the Size of the current Camera instance by the specified Vector2F.
public ResizeCamera ( Vector2F adjustment ) : void
adjustment Vector2F The representing how much to increase/decrease the .
return void

ScaleCamera() public method

Alters the Scale of the current Camera instance by the specified value.
public ScaleCamera ( float adjustment ) : void
adjustment float The value representing how much to zoom/unzoom the .
return void

SetPosition() public method

Updates the Position of the current Camera instance to the value specified.
public SetPosition ( PointF position ) : void
position Evbpc.Framework.Drawing.PointF A representing the new of the .
return void

SetScale() public method

Updates the Scale of the current Camera instance to the specified value.
public SetScale ( float scale ) : void
scale float The new value for the value of the .
return void

SetSize() public method

Updates the Size of the current Camera instance.
public SetSize ( SizeF size ) : void
size Evbpc.Framework.Drawing.SizeF A representing the new of the .
return void