• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Inferno
    • CollisionMode
    • DrawMode
    • Game
    • Game.OnResizeEventArgs
    • GameState
    • GameState.StateOnDrawEventArgs
    • GameWindow
    • Instance
    • MathHelper
    • Matrix
    • Point
    • Rectangle
    • Settings
    • SpatialMode
    • UpdateMode
    • Vector2
    • Vector3
    • Vector4
  • Inferno.Audio
    • AudioDevice
    • Sound
  • Inferno.Content
    • ContentLoader
  • Inferno.Formats.Audio
    • WaveFormat
  • Inferno.Formats.Graphics.Text
    • FontFormat
  • Inferno.Graphics
    • Camera
    • Color
    • GraphicsDevice
    • PlatformType
    • Renderable
    • RenderableType
    • Renderer
    • RenderSortMode
    • RenderTarget
    • Shader
    • ShaderLanguage
    • ShaderType
    • Sprite
    • Texture2D
    • Tileset
  • Inferno.Graphics.Text
    • Font
    • FontBuilder
  • Inferno.Input
    • ButtonState
    • Key
    • Keyboard
    • Keyboard.KeyEventArgs
    • KeyboardState
    • KeyState
    • Mouse
    • MouseState
  • Inferno.Tiled
    • RenderOrder
    • TiledLayer
    • TiledLayerChunk
    • TiledLoader
    • TiledMap
    • TiledMapOrientation
    • TiledObject
    • TiledObjectLayer
    • TiledVersion
  • Inferno.UI
    • MessageBox
    • MessageBoxType
    • UserInterface
  • Inferno.UI.Controls
    • Button
    • Control
    • Control.ControlClickedEvent
    • Control.ControlHoveredEvent
    • Control.TextChangedEventArgs
    • ControlState
    • Cursor
    • Label

Class Instance

A game object

Inheritance
System.Object
Instance
Implements
System.IDisposable
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
Assembly: Inferno.Desktop.dll
Syntax
public class Instance : IDisposable

Constructors

| Improve this Doc View Source

Instance(GameState)

Create a new instance

Declaration
public Instance(GameState parentState)
Parameters
Type Name Description
GameState parentState

The state that owns the instance

| Improve this Doc View Source

Instance(GameState, Vector2, Single, Boolean, Boolean, Instance)

Create a new instance

Declaration
public Instance(GameState parentState, Vector2 position, float depth = 0F, bool updates = false, bool draws = false, Instance parent = null)
Parameters
Type Name Description
GameState parentState

The state that owns the instance

Vector2 position

The instance position

System.Single depth

The depth to draw the instance

System.Boolean updates

Whether or not the instance updates

System.Boolean draws

Whether or not the instance draws

Instance parent

The instance that this inherits from

Fields

| Improve this Doc View Source

AffectedByGravity

Whether or not the Instance is affected by gravity

Declaration
public bool AffectedByGravity
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

CollisionMode

The current collision mode

Declaration
public CollisionMode CollisionMode
Field Value
Type Description
CollisionMode
| Improve this Doc View Source

CollisionRectangle

The Collision Rectangle. Uses coordinates relative to the texture. If null, the instance dimensions will be used

Declaration
public Rectangle? CollisionRectangle
Field Value
Type Description
System.Nullable<Rectangle>
| Improve this Doc View Source

Depth

The depth that the instance will be drawn at

Declaration
public float Depth
Field Value
Type Description
System.Single
| Improve this Doc View Source

Draws

Whether or not the instance draws

Declaration
public bool Draws
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

InheritsParentEvents

Whether or not the instance will inherit it's parent's events

Declaration
public bool InheritsParentEvents
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

Parent

The instance's parent

Declaration
public Instance Parent
Field Value
Type Description
Instance
| Improve this Doc View Source

ParentState

The state that owns the instance

Declaration
public readonly GameState ParentState
Field Value
Type Description
GameState
| Improve this Doc View Source

Roughness

The roughness of the Instance used for friction

Declaration
public float Roughness
Field Value
Type Description
System.Single
| Improve this Doc View Source

Sprite

The instance's sprite

Declaration
public Sprite Sprite
Field Value
Type Description
Sprite
| Improve this Doc View Source

Updates

Whether or not the instance updates

Declaration
public bool Updates
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

Velocity

The current velocity of the instance

Declaration
public Vector2 Velocity
Field Value
Type Description
Vector2

Properties

| Improve this Doc View Source

Bounds

The bounding box of the instance

Declaration
public Rectangle Bounds { get; }
Property Value
Type Description
Rectangle
| Improve this Doc View Source

CollisionMask

The sprite collision mask

Declaration
public Sprite CollisionMask { get; set; }
Property Value
Type Description
Sprite
| Improve this Doc View Source

Height

The height of the instance

Declaration
public int Height { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

NextPosition

Where the Instance will be next frame

Declaration
public Vector2 NextPosition { get; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

Position

The instance's position

Declaration
public Vector2 Position { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

Width

The width of the instance

Declaration
public int Width { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

X

The X Position of the Instance

Declaration
public float X { get; set; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

Y

The Y Position of the Instance

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

Methods

| Improve this Doc View Source

BeginUpdate()

BeginUpdate

Declaration
public virtual void BeginUpdate()
| Improve this Doc View Source

Clone()

Clone the instance

Declaration
public Instance Clone()
Returns
Type Description
Instance

A clone of the instance

| Improve this Doc View Source

Colliding(Vector2, Type)

Whether or not the instance is touching anything

Declaration
public bool Colliding(Vector2 pos, Type instanceType = null)
Parameters
Type Name Description
Vector2 pos

The position to check at (For pre-movement checks)

System.Type instanceType

A specific type to check for

Returns
Type Description
System.Boolean

Whether or not it is touching anything (or the specified type)

| Improve this Doc View Source

Colliding(Type)

Whether or not the instance is touching anything

Declaration
public bool Colliding(Type instanceType = null)
Parameters
Type Name Description
System.Type instanceType

A specific type to check for

Returns
Type Description
System.Boolean

Whether or not it is touching anything (or the specified type)

| Improve this Doc View Source

Destroy()

Destroy the instance. Alias for Dispose().

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

Dispose()

Dispose the instance

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

Draw(Renderer)

Draw the instance

Declaration
public virtual void Draw(Renderer renderer)
Parameters
Type Name Description
Renderer renderer

The game renderer

| Improve this Doc View Source

EndUpdate()

EndUpdate

Declaration
public virtual void EndUpdate()
| Improve this Doc View Source

RemoveParent()

Remove the instance's parent

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

SetParent(Instance)

Set the instance's parent

Declaration
public void SetParent(Instance parent)
Parameters
Type Name Description
Instance parent
| Improve this Doc View Source

Update()

Update

Declaration
public virtual void Update()

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX