Generated by DocFX

Class Camera

Ladybug Camera

Inheritance
System.Object
Camera
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public class Camera

Constructors

| Improve this Doc View Source

Camera(Viewport)

Creates a new Camera

Declaration
public Camera(Viewport viewport)
Parameters
Type Name Description
Microsoft.Xna.Framework.Graphics.Viewport viewport
| Improve this Doc View Source

Camera(Rectangle)

Creates a new Camera

Declaration
public Camera(Rectangle bounds)
Parameters
Type Name Description
Microsoft.Xna.Framework.Rectangle bounds

Properties

| Improve this Doc View Source

AllowedArea

World-relative bounds the Camera is restricted to

Declaration
public Rectangle AllowedArea { get; protected set; }
Property Value
Type Description
Microsoft.Xna.Framework.Rectangle
| Improve this Doc View Source

Bounds

Bounds of the Camera

Declaration
public Rectangle Bounds { get; protected set; }
Property Value
Type Description
Microsoft.Xna.Framework.Rectangle
| Improve this Doc View Source

Position

World-relative position of the Camera

Declaration
public Vector2 Position { get; protected set; }
Property Value
Type Description
Microsoft.Xna.Framework.Vector2
| Improve this Doc View Source

TransformMatrix

Matrix representing the Camera's size, scale, and rotation

Declaration
public Matrix TransformMatrix { get; protected set; }
Property Value
Type Description
Microsoft.Xna.Framework.Matrix
| Improve this Doc View Source

View

Bounds representing what is contained within the camera's view

Declaration
public Rectangle View { get; protected set; }
Property Value
Type Description
Microsoft.Xna.Framework.Rectangle
| Improve this Doc View Source

Zoom

Zoom level

Declaration
public float Zoom { get; protected set; }
Property Value
Type Description
System.Single

Methods

| Improve this Doc View Source

ClearAllowedArea()

Remove bounds restrictions

Declaration
public void ClearAllowedArea()
| Improve this Doc View Source

LerpTo(Vector2, Single)

Adjust the Camera's position via linear interpolation

Declaration
public void LerpTo(Vector2 newPosition, float by)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 newPosition
System.Single by
| Improve this Doc View Source

Move(Vector2)

Move the Camera relative to its current position

Declaration
public void Move(Vector2 newPosition)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 newPosition
| Improve this Doc View Source

ScreenToWorldSpace(Vector2)

Converts a location in screen position context to a location in world position context

Declaration
public Vector2 ScreenToWorldSpace(Vector2 source)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 source
Returns
Type Description
Microsoft.Xna.Framework.Vector2
| Improve this Doc View Source

SetAllowedArea(Rectangle)

Set the bounds the Camera must remain within

Declaration
public void SetAllowedArea(Rectangle r)
Parameters
Type Name Description
Microsoft.Xna.Framework.Rectangle r
| Improve this Doc View Source

SetPosition(Vector2)

Sets the Camera's position

Declaration
public void SetPosition(Vector2 newPosition)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 newPosition
| Improve this Doc View Source

SetZoom(Single)

Set the zoom level

Declaration
public void SetZoom(float z)
Parameters
Type Name Description
System.Single z
| Improve this Doc View Source

Update()

Updates the Camera

Declaration
public void Update()
| Improve this Doc View Source

ZoomBy(Single)

Adjust the zoom level relative to the current zoom level

Declaration
public void ZoomBy(float z)
Parameters
Type Name Description
System.Single z