Space class

Repersents the container for all objects in the scene for the current game.

This class is a wrapper around the ThreeJS Group (opens in a new tab) class.

Signature:

export class Space extends AugmentedGroup 

Extends: AugmentedGroup

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Space class.

Properties

Property

Modifiers

Type

Description

camera

readonly

any

Returns the current camera in the scene. cf MainCamera

components

ComponentManager

{ ComponentManager } - The component manager for the current game.

options

{ game: import("..").Game; externalApi: any; disableScripts?: boolean; signals?: import("..").GameSignals; loadOpts?: { looseMode?: boolean; }; }

physics

PhysicsRapierWrapper

{ PhysicsRapierWrapper } - The physics manager for the current game. Currently only Rapier is supported.

registry

ComponentsRegistry

{ ComponentsRegistry } - The components registry for the current game.

resources

ResourceManager

{ ResourceManager } - The resources manager for the current game.

Methods

Method

Modifiers

Description

captureFrame(opts)

Takes a screenshot of the current frame. Returns a promise that resolves to the data URL of the screenshot.

pause(payload)

Use this method to pause the current game.

resume(payload)

Use this method to resume the current game.

start(payload)

Use this method to start the current game.

stop(payload)

Use this method to stop the current game.