Ctrl+K

GameLauncher

Declaration

public class Strawberry.Web.GameLauncher

The game launcher for web assembly platform.

Implements: Strawberry.IGameLauncher

Constructors

GameLauncher

void GameLauncher()

Properties

GraphicsContext

IGraphicsContext GraphicsContext { get }

InputManager

IInputManager InputManager { get }

SoundManager

ISoundManager SoundManager { get }

Storage

IStorage Storage { get }

Methods

JSGameLoop static

int JSGameLoop(double time, nint userData)

Parameters:

Name Type Description
time System.Double
userData nint

Initialize

void Initialize(int width, int height)

Parameters:

Name Type Description
width System.Int32
height System.Int32

SetRootUrl

Sets the root url for asset loading

void SetRootUrl(string rootUrl)

Parameters:

Name Type Description
rootUrl System.String The root url

AOTDownload

Downloads a file from the root url and caches it in memory

Task AOTDownload(string path)

Parameters:

Name Type Description
path System.String Path to the file relative to the root url

Returns: Awaitable task

Run

void Run()

Events

Initialized

event Action Initialized

GameLoop

event Action GameLoop