C# Класс 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.
Наследование: ITrackableObject
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
OnTrackableObjectChanged ( TrackableObjectChangedEventArgs e ) : void
trackObject_TrackableObjectChanged ( object sender, TrackableObjectChangedEventArgs e ) : void

Описание методов

Camera() публичный Метод

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.
Результат Evbpc.Framework.Drawing

CenterCamera() публичный Метод

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
Результат void

CenterCamera() публичный Метод

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.
Результат void

Contains() публичный Метод

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.
Результат bool

MoveCamera() публичный Метод

Alters the Position of the current Camera instance by the specified Vector2F.
public MoveCamera ( Vector2F vector ) : void
vector Vector2F The distance to move the .
Результат void

ResizeCamera() публичный Метод

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 .
Результат void

ScaleCamera() публичный Метод

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 .
Результат void

SetPosition() публичный Метод

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 .
Результат void

SetScale() публичный Метод

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 .
Результат void

SetSize() публичный Метод

Updates the Size of the current Camera instance.
public SetSize ( SizeF size ) : void
size Evbpc.Framework.Drawing.SizeF A representing the new of the .
Результат void