• 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 GameState

GameState's contain Instances and controls them

Inheritance
System.Object
GameState
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 GameState

Constructors

| Improve this Doc View Source

GameState(Game)

Create a new game state

Declaration
public GameState(Game parentGame)
Parameters
Type Name Description
Game parentGame

Game that the state belongs to

| Improve this Doc View Source

GameState(Game, Int32, Int32, Color, Int32)

Create a new game state

Declaration
public GameState(Game parentGame, int stateWidth, int stateHeight, Color stateBackgroundColor, int spaceSize = 32)
Parameters
Type Name Description
Game parentGame

Game that the state belongs to

System.Int32 stateWidth

Width of the state

System.Int32 stateHeight

Height of the state

Color stateBackgroundColor

The state background color

System.Int32 spaceSize

The size for each spatial "block"

| Improve this Doc View Source

GameState(Game, Int32, Int32, Sprite, Int32)

Create a new game state

Declaration
public GameState(Game parentGame, int stateWidth, int stateHeight, Sprite stateBackground, int spaceSize = 32)
Parameters
Type Name Description
Game parentGame

Game that the state belongs to

System.Int32 stateWidth

Width of the state

System.Int32 stateHeight

Height of the state

Sprite stateBackground

The state background image

System.Int32 spaceSize

The size for each spatial "block"

Fields

| Improve this Doc View Source

Background

The state background image

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

BackgroundDepth

The depth to draw the background at

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

Camera

The game translation camera

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

DrawMode

The draw config

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

Height

The height of the state

Declaration
public int Height
Field Value
Type Description
System.Int32
| Improve this Doc View Source

OnDraw

On state drawn

Declaration
public EventHandler<GameState.StateOnDrawEventArgs> OnDraw
Field Value
Type Description
System.EventHandler<GameState.StateOnDrawEventArgs>
| Improve this Doc View Source

OnLoad

On state loaded

Declaration
public EventHandler OnLoad
Field Value
Type Description
System.EventHandler
| Improve this Doc View Source

OnUnLoad

On state unloaded

Declaration
public EventHandler OnUnLoad
Field Value
Type Description
System.EventHandler
| Improve this Doc View Source

OnUpdate

On state updated

Declaration
public EventHandler OnUpdate
Field Value
Type Description
System.EventHandler
| Improve this Doc View Source

ParentGame

The game that the state belongs to

Declaration
public readonly Game ParentGame
Field Value
Type Description
Game
| Improve this Doc View Source

SafeZone

The safe zone

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

SafeZoneEnabled

Whether or not the safe zone is enabled

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

SpaceSize

The size of each spatial "block"

Declaration
public readonly int SpaceSize
Field Value
Type Description
System.Int32
| Improve this Doc View Source

SpatialMode

The spatial hashing config

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

UpdateMode

The Update config

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

UserInterface

The state user interface

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

Width

The width of the state

Declaration
public int Width
Field Value
Type Description
System.Int32

Properties

| Improve this Doc View Source

Bounds

The state bounds

Declaration
public Rectangle Bounds { get; }
Property Value
Type Description
Rectangle

Methods

| Improve this Doc View Source

AddInstance(Instance)

Add an instance to the state

Declaration
public void AddInstance(Instance instance)
Parameters
Type Name Description
Instance instance

Instance to add

| Improve this Doc View Source

ClearInstances()

Remove all instances from the state

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

GetInstancesAt(Vector2, Boolean)

Get instances at the given position

Declaration
public List<Instance> GetInstancesAt(Vector2 position, bool boundBySafearea = false)
Parameters
Type Name Description
Vector2 position

Position

System.Boolean boundBySafearea

Search only within the safe zone

Returns
Type Description
System.Collections.Generic.List<Instance>
| Improve this Doc View Source

GetNearbyInstances(Instance)

Get instances near the given instance

Declaration
public List<Instance> GetNearbyInstances(Instance instance)
Parameters
Type Name Description
Instance instance

Instance to look around

Returns
Type Description
System.Collections.Generic.List<Instance>

All instances within one spatial "block" of the given instance

| Improve this Doc View Source

RemoveInstance(Instance)

Remove an instance from the state

Declaration
public void RemoveInstance(Instance instance)
Parameters
Type Name Description
Instance instance

Instance to remove

| Improve this Doc View Source

Spatial_GetSpaces(Instance)

Get all the spaces that contain the instance

Declaration
public List<int> Spatial_GetSpaces(Instance instance)
Parameters
Type Name Description
Instance instance
Returns
Type Description
System.Collections.Generic.List<System.Int32>
| Improve this Doc View Source

Spatial_GetSpaces(Rectangle)

Declaration
public List<int> Spatial_GetSpaces(Rectangle rect)
Parameters
Type Name Description
Rectangle rect
Returns
Type Description
System.Collections.Generic.List<System.Int32>
| Improve this Doc View Source

Spatial_MoveInstance(Rectangle, Rectangle, Instance)

Declaration
public void Spatial_MoveInstance(Rectangle oldBounds, Rectangle newBounds, Instance instance)
Parameters
Type Name Description
Rectangle oldBounds
Rectangle newBounds
Instance instance
  • Improve this Doc
  • View Source
Back to top Generated by DocFX