GameStateManager

Package: Libraries.Game · Inherits from: Libraries.Language.Object

The GameStateManager is an internal class, used by the game engine to communicate between Quorum and plugin code. Most users will never have to interface with this class directly. The one exception is GetComputeDevice, which any program, with or without a game, uses to run compute programs on the graphics card (see Libraries.Compute.Hardware.HardwareCompute).

Actions

GetAccessibility()

This action returns the AccessibilityManager that is being used across the Game.

Returns

Libraries.Interface.Accessibility

GetApplication()

This action returns the application stored by the plugins.

Returns

Libraries.Game.Application

GetComputeDevice()

This action returns the program's compute device: a graphics card that can run compute programs, shared by every computation in the program. It is the running game's when a game is drawing with a graphics system that can compute (Vulkan); otherwise the first call makes one with no window, which later calls return. It doesn't depend on the graphics system: under it is Vulkan on desktop, iOS and Android, and later WebGPU on the web.

Returns

Libraries.Compute.Hardware.HardwareComputeDevice: the device, or undefined if this system has no graphics card that can compute.

Example

use Libraries.Game.GameStateManager
use Libraries.Compute.Hardware.HardwareComputeDevice
use Libraries.Compute.Hardware.HardwareCompute

GameStateManager manager
HardwareComputeDevice device = manager:GetComputeDevice()
if device not= undefined
    HardwareCompute compute = device:CreateCompute()
    // SetProgram, SetData, Run, GetValues
    compute:Dispose()
end

GetFocus()

This action returns the current Item that is focused.

Returns

Libraries.Interface.Item

GetFocusManager()

This action returns the FocusManager which is being used across the Game.

Returns

Libraries.Game.FocusManager

GetFontManager()

This action returns the FontManager which is being used across the Game.

Returns

Libraries.Game.Graphics.Fonts.FontManager

GetGame()

This action returns a reference to the Game class.

Returns

Libraries.Game.Game

GetGameDisplay()

This action returns the GameDisplay stored by the plugins.

Returns

Libraries.Game.GameDisplay

GetGameGraphics()

This action returns the GraphicsManager stored by the plugins.

Returns

Libraries.Game.Graphics.GraphicsManager

GetInput()

This action returns a GameInput object that is stored in the plugins.

Returns

Libraries.Game.GameInput

GetInterfaceOptions()

Returns

Libraries.Interface.Options.InterfaceOptions

GetMainThreadName()

This action returns the identifier for the main thread. Any work that interacts directly with teh graphics system, including adding or removing items from the game, must be done on the main thread -- otherwise, an error will occur.

Returns

text

GetNativePath()

This action returns the path of the native file loaded by the engine.

Returns

text

GetOperatingSystem()

This action returns a text flag indicating what operating system the game is running on.

Returns

text

GetShaderManager()

This action returns the ShaderManager which is being used across the Game.

Returns

Libraries.Game.Graphics.Shaders.ShaderManager

GetSharedTextureManager()

This action returns the SharedTextureManager which is being used across the Game.

Returns

Libraries.Game.Graphics.SharedTextureManager

GetTooltipManager()

This action returns the TooltipManager which is being used across the Game, or undefined if there is no game.

Returns

Libraries.Interface.TooltipManager

IsDisplayAvailable()

The IsDisplayAvailable action returns whether or not a display is available to draw on. If no display is available, actions that try to create or draw graphics (such as loading a Drawable) will create an error. This will return false if called before StartGame() is called in the Game class, and will typically return true after the game has been started.

Returns

boolean

SetAccessibility(Libraries.Interface.Accessibility accessibility)

This action sets the Accessibility to be used across the Game.

Parameters

SetApplication(Libraries.Game.Application app)

This action is used by the engine to set the game's application info in the plugins.

Parameters

SetComputeDevice(Libraries.Compute.Hardware.HardwareComputeDevice device)

This action sets the program's compute device. VulkanGraphics calls it when it has finished starting, with a device sharing the game's, so computations made from then on use the game's device. Computations made before keep the device they were made on.

Parameters

Example

use Libraries.Game.GameStateManager
use Libraries.Compute.Hardware.Vulkan.VulkanComputeDevice

GameStateManager manager
VulkanComputeDevice device
if device:Start()
    manager:SetComputeDevice(device)
end

SetFocus(Libraries.Interface.Item item)

This action sets the focus on the given item.

Parameters

SetFocusManager(Libraries.Game.FocusManager manager)

This action sets the FocusManager to be used across the Game.

Parameters

SetFontManager(Libraries.Game.Graphics.Fonts.FontManager manager)

This action sets the FontManager to be used across the Game.

Parameters

SetGame(Libraries.Game.Game game)

This action is used by the engine to store a reference to the currently running Game class.

Parameters

SetGameDisplay(Libraries.Game.GameDisplay disp)

This action is used by the engine to set the game's display info in the plugins.

Parameters

SetGameGraphics(Libraries.Game.Graphics.GraphicsManager gl20)

This action is used by the engine to set the game's graphics manager in the plugins.

Parameters

SetInput(Libraries.Game.GameInput gameInput)

This action sets a GameInput object to be stored in the plugins.

Parameters

SetInterfaceOptions(Libraries.Interface.Options.InterfaceOptions options)

Parameters

SetMainThreadName(text name)

This action sets the identifier for the main thread. Any work that interacts directly with the graphics system, including adding or removing items from the game, must be done on the main thread. This is set automatically by the game engine, and users should never need to call this directly.

Parameters

  • name text

SetNativePath(text path)

This action sets a path to the native file used to load the engine's C plugins. After setting the path, the engine will load the native file.

Parameters

  • path text

SetOperatingSystem(text os)

This action sets a flag in the plugins indicating what operating system the game is running on.

Parameters

  • os text

SetTooltipManager(Libraries.Interface.TooltipManager tooltips)

This action sets the TooltipManager to be used across the Game. The TooltipManager shows, places and hides the tooltips of the game's controls.

Parameters

Inherited Actions

3 actions from Libraries.Language.Object