Class Game
The entire Game. This contains everything in the game world.
Inheritance
Implements
Inherited Members
Namespace: Inferno
Assembly: Inferno.Desktop.dll
Syntax
public class Game : IDisposable
Constructors
| Improve this Doc View SourceGame()
Create a new game with the default size of 1280x768
Declaration
public Game()
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 SourceAudioDevice
The game audio device
Declaration
public AudioDevice AudioDevice
Field Value
Type | Description |
---|---|
AudioDevice |
BackColor
The back color to be displayed if things are out of bounds
Declaration
public Color BackColor
Field Value
Type | Description |
---|---|
Color |
CurrentStateId
The current state id
Declaration
public int CurrentStateId
Field Value
Type | Description |
---|---|
System.Int32 |
FocusPause
Whether or not the game should auto pause when window focus is lost
Declaration
public bool FocusPause
Field Value
Type | Description |
---|---|
System.Boolean |
FramesPerSecond
The number of frames displayed per second.
Declaration
public int FramesPerSecond
Field Value
Type | Description |
---|---|
System.Int32 |
GraphicsDevice
The Graphics Device
Declaration
public GraphicsDevice GraphicsDevice
Field Value
Type | Description |
---|---|
GraphicsDevice |
OnActivated
Declaration
public EventHandler OnActivated
Field Value
Type | Description |
---|---|
System.EventHandler |
OnDeactivated
Declaration
public EventHandler OnDeactivated
Field Value
Type | Description |
---|---|
System.EventHandler |
OnExit
Declaration
public EventHandler OnExit
Field Value
Type | Description |
---|---|
System.EventHandler |
OnResize
Declaration
public EventHandler<Game.OnResizeEventArgs> OnResize
Field Value
Type | Description |
---|---|
System.EventHandler<Game.OnResizeEventArgs> |
Paused
Whether or not the game is running
Declaration
public bool Paused
Field Value
Type | Description |
---|---|
System.Boolean |
Renderer
The Game renderer
Declaration
public static Renderer Renderer
Field Value
Type | Description |
---|---|
Renderer |
VirtualHeight
The target height
Declaration
public int VirtualHeight
Field Value
Type | Description |
---|---|
System.Int32 |
VirtualWidth
The target width
Declaration
public int VirtualWidth
Field Value
Type | Description |
---|---|
System.Int32 |
Window
The Game window
Declaration
public readonly GameWindow Window
Field Value
Type | Description |
---|---|
GameWindow |
Properties
| Improve this Doc View SourceCurrentState
The current visible state
Declaration
public GameState CurrentState { get; }
Property Value
Type | Description |
---|---|
GameState |
Methods
| Improve this Doc View SourceAddState(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 |
Dispose()
Declaration
public void Dispose()
Exit()
Exit the game.
Declaration
public void Exit()
Initialize()
Initialise the game
Declaration
protected virtual void Initialize()
LoadContent()
Load all game content
Declaration
protected virtual void LoadContent()
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 |
Run()
Launch the game
Declaration
public void Run()
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 |
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 |
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 |
UnloadContent()
Declaration
protected virtual void UnloadContent()