Skip to content

Class GameLibrary

Namespace: Apogee.Host
Assembly: Apogee.Host.dll

What a game asks of the program that runs it, as the script table game: ending the run (a menu's Quit), and whether the Escape key still ends it. A shipped game's menu does the first; one with a pause menu of its own does the second, since Escape is its key.

[ScriptLibrary("game")]
public static class GameLibrary

Inheritance

object ← GameLibrary

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

EscapeQuits

Whether Escape ends a run in a window (the default: it is how a script or a sample is closed). Games with their own Escape menu turn it off.

public static bool EscapeQuits { get; }

Property Value

bool

QuitRequested

True once a script called game.quit(); the loops end at the end of the frame.

public static bool QuitRequested { get; }

Property Value

bool

Methods

Quit()

Ends the run at the end of this frame (the window closes, a headless run stops).

public static void Quit()

SetEscapeQuits(bool)

Says whether the Escape key ends the run. A game that uses Escape for its own menu says false.

public static void SetEscapeQuits(bool quits)

Parameters

quits bool

SetTimeScale(double)

Sets how fast game time runs (1 is normal, 0.5 half speed, 0 stops it, 2 doubles it), from 0 to 100; a larger number is 100. It scales the physics, the world's systems and the game clock of task (task.wait, task.delay, task.every, task.time); task.wait_real, audio, the user interface and input keep real time. A new game starts at 1.

public static void SetTimeScale(double scale)

Parameters

scale double

TimeScale()

The time scale set by set_time_scale (1 by default).

public static double TimeScale()

Returns

double