Class Camera
A view camera
Inheritance
System.Object
Camera
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Inferno.Graphics
Assembly: Inferno.Desktop.dll
Syntax
public class Camera
Properties
| Improve this Doc View SourcePosition
The current center position
Declaration
public Vector2 Position { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
Rotation
Rotation in degrees
Declaration
public float Rotation { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
TranslationMatrix
The translation matrix used with the draw calls associated with the state
Declaration
public Matrix TranslationMatrix { get; }
Property Value
Type | Description |
---|---|
Matrix |
ViewportCenter
The center of the viewport
Declaration
public Vector2 ViewportCenter { get; }
Property Value
Type | Description |
---|---|
Vector2 |
ViewportHeight
The height of the visible viewport
Declaration
public int ViewportHeight { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ViewportWidth
The width of the visible viewport
Declaration
public int ViewportWidth { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ViewportWorldBoundry
The viewport world boundary
Declaration
public Rectangle ViewportWorldBoundry { get; }
Property Value
Type | Description |
---|---|
Rectangle |
Zoom
The scale factor of the view
Declaration
public float Zoom { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
| Improve this Doc View SourceCenterOn(Vector2)
Center the camera on a position.
Declaration
public void CenterOn(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position |
Drawable(Rectangle)
Check if a rectangle will be visible on the screen
Declaration
public bool Drawable(Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rect |
Returns
Type | Description |
---|---|
System.Boolean |
ScreenToWorld(Vector2)
Convert a screen coordinate to a world coordinate
Declaration
public Vector2 ScreenToWorld(Vector2 screenPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | screenPosition |
Returns
Type | Description |
---|---|
Vector2 |
WorldToScreen(Vector2)
Convert a world coordinate to a screen coordinate
Declaration
public Vector2 WorldToScreen(Vector2 worldPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | worldPosition |
Returns
Type | Description |
---|---|
Vector2 |