Table of Contents

Class Game

Namespace
Fantas
Assembly
Fantas.dll

Main Game

public class Game
Inheritance
Game
Inherited Members

Constructors

Game()

Constructor

public Game()

Game(Size)

public Game(Size preferredWindowSize)

Parameters

preferredWindowSize Size

on Desktop the preferred window size (in points)

Properties

CurrentScene

Current Scene presented

public Scene CurrentScene { get; }

Property Value

Scene

GameOptions

Get current game options set on Game object

public GameOptions GameOptions { get; }

Property Value

GameOptions

Instance

Game singleton instance

public static Game Instance { get; }

Property Value

Game

IsFullScreen

Change/Get Window Full Screen mode

public bool IsFullScreen { get; set; }

Property Value

bool

RunOneFrame

Flag to make Run, only render one frame. (only works on MonoGame backend)

protected bool RunOneFrame { get; set; }

Property Value

bool

ScaleMode

Scene Scale Mode, need to be set before creating the scene

public SceneScaleMode ScaleMode { get; set; }

Property Value

SceneScaleMode

WindowSize

Change the Windows Size This will work mostly on Desktop implementation,

public Size WindowSize { get; set; }

Property Value

Size

WindowTitle

Change the Windows Title This will work mostly on Desktop implementation,

public string WindowTitle { get; set; }

Property Value

string

Methods

Exit()

Terminate the Application (this has no effect on mobile)

public void Exit()

GetSceneSnapshot()

Get a PNG buffer representation of the presented Scene

public byte[] GetSceneSnapshot()

Returns

byte[]

Return current scene frame as PNG encoded in a byte array

PresentScene(Scene)

Present a scene

public void PresentScene(Scene scene)

Parameters

scene Scene

Exceptions

ArgumentNullException

Run()

Run the game main loop

public void Run()

WindowSizeChanged()

Called when Window is resized

public virtual void WindowSizeChanged()