API Reference

oo-mono package

Classes

ClassDescription
AudioComponent

Audio component, used to play audio in the game

See AudioComponentData for the data schema used to create an audio component

AvatarComponent

Avatar component, used to display VRM avatars in the game (for more info on VRM files, see VRM site (opens in a new tab))

See AvatarComponentData for the data schema used to create an audio component

BackgroundComponent

The background component is used to set the background of the game. You can set the background appareance from the studio.

At runtime right now you can only change the color of the background, but we plan to add more options in the future.

Bakckground is a singleton, so you can only have one background in the game.

BirdComponent

A component to display birds in the game.

See BirdComponentData for the data schema used to create a bird component

BulletComponent

A component to display bullets in the game. Once created, the bullet will move in the given direction at the given speed.

See BulletComponentData for the data schema used to create a bullet component

CGameClientA Game client instance is used to join a game room on the server
CloudComponent

A component to display clouds in the game.

See CloudComponentData for the data schema used to create a cloud component

Collider

This class encapsulates the physics entities attached to a component (rigid body, collider).

it offers some convenience methods to physics properties of the component.

For more info on the underlying physics engine, cf Rapier docs (opens in a new tab)

Component3D
ComponentManagerA ComponentManager is a container for all the components of a space. It is responsible for creating, destroying and duplicating components.
ControlsFactory

Use this to create controls for your game, Currently supports the following types:

- PlatformerControlsWrapper for a WASD + Space type of navigation

- ThirdPersonCameraControlsWrapper for a third person camera movement

- FirstPersonCameraControlsWrapper for a first person camera movement

- DebugOrbitControlsWrapper for a debug orbit camera movement

- FlyCameraControlsWrapper for a fly camera movement

DebugOrbitControlsWrapper

Those controls are for debug purposes only. OrbitControls performs orbiting, dollying (zooming), and panning.

Orbit - left mouse / touch: one-finger move

Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish

Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move

DeviceDevice information
DustComponent

A component to display dust that follows a target in the game. You can use this component to create a trail of dust that follows a player, for example.

See DustComponentData for the data schema used to create a dust component

EnvmapComponent

This component is used to display an environment map in the game. Use the studio to configure the environment for the space.

This is a singleton component. You can only have one environment map in the game.

FirstPersonCameraControlsWrapper

The class is used to implement first person camera controls.``

The meaning of object & target options is intepreted as follows:

- The object is typically set to the camera object being controlled

- The target is the object that the camera will follow

FlyCameraControlsWrapper

The class is used to implement fly camera controls.

It takes in the object parameter which is the camera object being controlled

FogComponent

This component is used to activate a fog in the game. Use the studio to configure the fog for the space.

This is a singleton component. You can only have one fog in the game.

GameRoomThis class is used to communicate with the game server and sync the game state
GameStorageApiThis class provides an API to store and retrieve data from the games.
GodrayComponent

A component to display godrays effect in the game.

See GodrayComponentData for the data schema used to create a godray component

ImageComponent

Image component, used to display images in the game (.png, .jpg, .jpeg)

See ImageComponentData for the data schema used to create an image component

KitBashComponent

This component is used to display Kit Assets elements in the game

See KitbashComponentData for the data schema used to create a kitbash component

LightingComponent

This component is used to controls lighting in the game. Use the studio to configure the lighting for the space.

This is a singleton component. You can only have one lighting in the game.

MagneticFieldComponent

A component to display magnetic field like effect in the game.

See MagneticFieldComponentData for the data specification to create a magnetic field component.

MainCameraMain camera used to render the scene, this is actually an instance of three.js PerspectiveCamera (opens in a new tab)
MeshComponent

Mesh component, used to display simple meshes in the game (box, sphere, cylinder)

See MeshComponentData for the data schema used to create a mesh component

ModelComponent

Model component, used to display gltf 3D models in the game (.gltf, .glb)

See ModelComponentData for the data schema used to create a model component

PhysicsRapierWrapper

Wrapper for the physics engine, currently using Rapier3D

This is the type of the Physics variable in the scripting API

PlatformComponent

A component to display sliding platforms in the game.

See PlatformComponentData for the data schema used to create a platform component

PlatformerControlsWrapper

This class implements traditional platformer controls, with support for jumping, running, etc

the controls use keyboard keys W, A, S, D or Arrow keys for movement, and SPACE for jumping;

The meaning of object & target options is intepreted as follows:

- The object is moved by the controls actions

- The target is used to determine the forward direction of the movement

The behavior of the controls can be customized using the params object. See PlatformerControlsWrapperParams for more info

PlatformerInputControllerThis class is used to control the actions of the PlatformerControlsWrapper class.
PlayerManagerA class to access to all player entities on the game
PlayerWrapper

Represents a player entity in the game.

A PlayerWrapper instance is always created for the main player of the game; In mulitplayer mode, a PlayerWrapper instanceRor remote players in mulitplayer mode.

By default an avatar component is created for each player. You can customise the avatar used by the game using the current snippet in the onPreload method of the script

PostProcessingComponent

Post processing component, used to apply post processing effects to the game. Use the studio to configure the post processing for the space.

This is a singleton component. You can only have one post processing in the game.

RainComponent

This component is used to display rain in the game. Use the studio to configure the rain for the space.

This is a singleton component. You can only have one rain in the game.

ReflectorComponent

This component is used to display a reflective plan in the game. Use the studio to configure the reflector for the space.

This is a singleton component. You can only have one reflector in the game. For performance reasons, adding both a water and a reflector component to the same space is not supported.

RigidBodyWrapper
ShadowFloorComponent

Represents a component that adds a transparent floor that support shadows.

* See for the data schema used to create a platform component

Space

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.

SpawnComponent

This component is used to configure where the player will spawn, initially, in the game. Use the studio to configure the spawn for the space.

This is a singleton component.

TerrainComponentTerrain component, used to create terrains in the game. Use the studio to add terrains to the space.
TextComponent

Text component, used to display text in the game.

See TextComponentData for the data schema used to create a text component

ThirdPersonCameraControlsWrapper

This class is used to implement third person camera mode.

The controls use mouse movements to rotate the camera around the target object; By default the conttrols controller will enter pointer lock mode when the user clicks on the canvas. To disable this behavior set the usePointerLock property to false on the controls controller.

The behavior of the controls can be customized by passing a ThirdPersonCameraControlsWrapperParams object to the constructor

The meaning of object & target options is intepreted as follows:

- The object is typically set to the camera object being controlled

- The target is the object that the camera will follow from the given maxZoomOut distance

VideoComponent

This component is used to display a video in the game.

See VideoComponentData for the data schema used to create a video component

WaterComponent

Water component, used to display water in the game. Use the studio to add a water component to the space.

This is a singleton component, so you can only have one water component in the game. For performance reasons Adding both a water and a reflector component to the same space is not supported.

WaveComponent

A component to display a wave effect in the game.

See WaveComponentData for the data schema used to create a wave component

WindComponent

A component to display a spiralling wind in the game. The wind will affect all objects colliding with it by pushing them up.

See WindComponentData for the data schema used to create a wind component

Functions

FunctionDescription
seconds(secs)Returns a promise that resolves after a number of seconds has passed

Interfaces

InterfaceDescription
AudioComponentDataData for the AudioComponent, see ComponentManager.create() on how to create a component
AvatarComponentDataData specification for AvatarComponent, see ComponentManager.create() on how to create a component
BaseIntersectionEventBase interface for all collision/sensor events.
BaseRoomState
BirdComponentDataData specification for BirdComponent, see ComponentManager.create() on how to create a component
BoxParamsData

Params for the property

See BoxGeometry (opens in a new tab)

BulletComponentDataData specification for BulletComponent, see ComponentManager.create() on how to create a component
CloudComponentDataData specification for CloudComponent, see ComponentManager.create() on how to create a component
CollisionEnterEventPayload for the collision enter event; see {@link Component3D.onCollisionEnter()
CollisionExitEventPayload for the collision exit event; see {@link Component3D.onCollisionExit()
Component3DDataBase class for all components data interfaces. It contains the common properties for all components
ContactPoint
ControlsFactoryOpts
CylinderParamsData

Params for the property

See CylinderGeometry (opens in a new tab)

DustComponentDataData specification for DustComponent, see ComponentManager.create() on how to create a component
GodrayComponentDataData specification for GodrayComponent, see ComponentManager.create() on how to create a component
ImageComponentDataData specification for ImageComponent, see ComponentManager.create() on how to create a component
JoinRoomOpts
KitbashComponentDataData specification for KitBashComponent, see ComponentManager.create() on how to create a component
MagneticFieldComponentDataData specification for MagneticFieldComponent, see ComponentManager.create() on how to create a component
MeshComponentDataData specification for MeshComponent, see ComponentManager.create() on how to create a component
MeshGeometryDataGeometry data for the MeshComponentData.geometry property
ModelComponentDataData specification for ModelComponent, see ComponentManager.create() on how to create a component
PCActions
PCJumpParams
PCRunParams
PhysicsData

This interface describes the data schema used to attach collision data to a component.

See Component3DData.collider

PlatformComponentDataData specification for PlatformComponent, see ComponentManager.create() on how to create a component
PlatformerControlsWrapperParams
PlayerAvatarOpts
PlayerData
ScriptDataAttach an identifier or a tag to a component, so that it can be easily accessed in the ComponentManager.byId() or ComponentManager.byTag() methods
SensorEvent
SphereParamsData

Params for the property

See SphereGeometry (opens in a new tab)

TextComponentDataData specification for TextComponent, see ComponentManager.create() on how to create a component
ThirdPersonCameraControlsWrapperParams
VideoComponentDataData specification for VideoComponent, see ComponentManager.create() on how to create a component
WaveComponentDataData specification for WaveComponent, see ComponentManager.create() on how to create a component
WindComponentDataData specification for WindComponent, see ComponentManager.create() on how to create a component
XYZThis is a shared interface used to represent various 3D coordinates in component data (position, rotation, scale ...)

Namespaces

NamespaceDescription
Materials
Plugins
Utils

Variables

VariableDescription
CameraCurrent camera instance, cf MainCamera for more info
ComponentsComponent manager for the current space, cf ComponentManager for more info
ControlsUse this to create controls for your game, cf ControlsFactory for more info
Emitter

Use this to register listeners for events on the game (ready, update, etc)

See Events for the list of events you can listen to

EventsAn object containing all the events that can listened from scripting.
GameClient

This is the main entry point for mulitplayer games on the frontend.

A Game client instance is used to join a game room on the server

GameStorageThe GameStorage instance is used to store and retrieve data from the game storage.
OOOBjectsObject containing helpers for creating meshes and materials in accordance with the internal pipeline of the engine
OOUI
PhysicsPhysics manager for the current space, cf PhysicsRapierWrapper for more info
PlayerRepresents the main player entity on the game; cf PlayerWrapper for more info
PlayersGives access to all player entities on the game; cd for more info
UI
WorldCurrent space hosting the game, cf Space for more info

Type Aliases

Type AliasDescription
ColliderType
ComponentTypes
ControlsParams
ControlsType
RigidBodyType