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

The entire Game. This contains everything in the game world.

Inheritance
System.Object
Game
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 Game : IDisposable

Constructors

| Improve this Doc View Source

Game()

Create a new game with the default size of 1280x768

Declaration
public Game()
| Improve this Doc View Source

Game(Int32, Int32, String, Int32, Boolean, Boolean)

Create a new game

Declaration
public Game(int intendedWidth, int intendedHeight, string title = "Created with Inferno", int fps = 30, bool fullscreen = false, bool vsync = true)
Parameters
Type Name Description
System.Int32 intendedWidth

The intended width of the game

System.Int32 intendedHeight

The intended height of the game

System.String title

The window title

System.Int32 fps

The number of updates to be called every second

System.Boolean fullscreen

Whether or not the game will start in fullscreen

System.Boolean vsync

Whether or not VSync is enabled

Fields

| Improve this Doc View Source

AudioDevice

The game audio device

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

BackColor

The back color to be displayed if things are out of bounds

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

CurrentStateId

The current state id

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

FocusPause

Whether or not the game should auto pause when window focus is lost

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

FramesPerSecond

The number of frames displayed per second.

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

GraphicsDevice

The Graphics Device

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

OnActivated

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

OnDeactivated

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

OnExit

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

OnResize

Declaration
public EventHandler<Game.OnResizeEventArgs> OnResize
Field Value
Type Description
System.EventHandler<Game.OnResizeEventArgs>
| Improve this Doc View Source

Paused

Whether or not the game is running

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

Renderer

The Game renderer

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

VirtualHeight

The target height

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

VirtualWidth

The target width

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

Window

The Game window

Declaration
public readonly GameWindow Window
Field Value
Type Description
GameWindow

Properties

| Improve this Doc View Source

CurrentState

The current visible state

Declaration
public GameState CurrentState { get; }
Property Value
Type Description
GameState

Methods

| Improve this Doc View Source

AddState(GameState)

Add a new state into the game

Declaration
protected int AddState(GameState state)
Parameters
Type Name Description
GameState state

The State to add

Returns
Type Description
System.Int32

The State ID

| Improve this Doc View Source

Dispose()

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

Exit()

Exit the game.

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

Initialize()

Initialise the game

Declaration
protected virtual void Initialize()
| Improve this Doc View Source

LoadContent()

Load all game content

Declaration
protected virtual void LoadContent()
| Improve this Doc View Source

Resize(Int32, Int32)

Resize the game

Declaration
public void Resize(int width, int height)
Parameters
Type Name Description
System.Int32 width

New width

System.Int32 height

New height

| Improve this Doc View Source

Run()

Launch the game

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

SetState(GameState)

Set the game state using a State instance

Declaration
public void SetState(GameState state)
Parameters
Type Name Description
GameState state

State to jump to

| Improve this Doc View Source

SetState(Int32)

Set the game state using an ID

Declaration
public void SetState(int state)
Parameters
Type Name Description
System.Int32 state

The state ID to set

| Improve this Doc View Source

SetState(Type)

Set the game state using a State type

Declaration
public void SetState(Type stateType)
Parameters
Type Name Description
System.Type stateType

State Type to jump to

| Improve this Doc View Source

UnloadContent()

Declaration
protected virtual void UnloadContent()

Implements

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