Home Reference Source
import {Application} from 'shapez.io/js/application.js'
public class | source

Application

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public
public

gameAnalytics: import("./platform/game_analytics").GameAnalyticsInterface

public
public
public
public
public
public
public
public
public
public
public
public

sound: import("./platform/sound").SoundInterface

public
public

storage: import("./platform/storage").StorageInterface

public

ticker: *

public

trackedIsRenderable: TypedTrackedState<boolean>

public

Method Summary

Public Methods
public

async boot()

Boots the application

public

checkResize(forceUpdate: boolean)

Checks if the app resized.

public

Deinitializes the application

public

Returns the effective ui sclae

public

handleMousemove(event: MouseEvent)

Handles a mouse move event

public

handleVisibilityChange(event: Event)

Handles a page visibility change event

public

Initializes all platform instances

public

Returns if the app is currently visible

public
public

Background frame update callback

public

onBeforeUnload(event: *)

Internal before-unload handler

public

onBlur()

Internal blur handler

public

Internal on focus handler

public

Frame update callback

public

onUnload(event: *)

Internal unload handler

public

Registers all event listeners

public

Registers all game states

public

Callback after ui scale has changed

public

updateFocusAfterUserInteraction(event: TouchEvent)

Checks the focus after a touch

Public Constructors

public constructor() source

Public Members

public adProvider: AdProviderInterface source

public analytics: AnalyticsInterface source

public applicationPaused: boolean source

public backgroundResourceLoader: * source

public focused: boolean source

public gameAnalytics: import("./platform/game_analytics").GameAnalyticsInterface source

public inputMgr: * source

public lastResizeCheck: * source

public mousePosition: Vector | null source

public onAboutClicked: * source

public pageVisible: boolean source

public platformWrapper: PlatformWrapperInterface source

public restrictionMgr: * source

public savegameMgr: * source

public screenHeight: number source

public screenWidth: number source

public settings: * source

public sound: import("./platform/sound").SoundInterface source

public stateMgr: * source

public storage: import("./platform/storage").StorageInterface source

public ticker: * source

public trackedIsRenderable: TypedTrackedState<boolean> source

public unloaded: boolean source

Public Methods

public async boot() source

Boots the application

public checkResize(forceUpdate: boolean) source

Checks if the app resized. Only does this once in a while

Params:

NameTypeAttributeDescription
forceUpdate boolean

Forced update of the dimensions

public deinitialize(): * source

Deinitializes the application

Return:

*

public getEffectiveUiScale(): * source

Returns the effective ui sclae

Return:

*

public handleMousemove(event: MouseEvent) source

Handles a mouse move event

Params:

NameTypeAttributeDescription
event MouseEvent

public handleVisibilityChange(event: Event) source

Handles a page visibility change event

Params:

NameTypeAttributeDescription
event Event

public initPlatformDependentInstances() source

Initializes all platform instances

public isRenderable(): * source

Returns if the app is currently visible

Return:

*

public onAppRenderableStateChanged(renderable: *) source

Params:

NameTypeAttributeDescription
renderable *

public onBackgroundFrame(dt: number) source

Background frame update callback

Params:

NameTypeAttributeDescription
dt number

public onBeforeUnload(event: *) source

Internal before-unload handler

Params:

NameTypeAttributeDescription
event *

public onBlur() source

Internal blur handler

public onFocus() source

Internal on focus handler

public onFrameEmitted(dt: number) source

Frame update callback

Params:

NameTypeAttributeDescription
dt number

public onUnload(event: *) source

Internal unload handler

Params:

NameTypeAttributeDescription
event *

public registerEventListeners() source

Registers all event listeners

public registerStates() source

Registers all game states

public updateAfterUiScaleChanged() source

Callback after ui scale has changed

public updateFocusAfterUserInteraction(event: TouchEvent) source

Checks the focus after a touch

Params:

NameTypeAttributeDescription
event TouchEvent