API Reference

oo-mono package

Classes

Class

Description

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.

BasicCharacterController

A controller class that can be used to control kinematic rigid bodies. This is a convenient class that wraps the Rapier's Character controller (opens in a new tab) class.

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

CGameClient

A 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

ComponentManager

A 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:

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

Device

Device 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.

GameRoom

This class is used to communicate with the game server and sync the game state

GameStorageApi

This 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.

MainCamera

Main 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

PlatformerInputController

This class is used to control the actions of the PlatformerControlsWrapper class.

PlayerManager

A 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.

PrefabResource

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.

Resource

RigidBodyWrapper

ScriptBehavior

ScriptComponent

ShadowFloorComponent

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.

Store

TerrainComponent

Terrain 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

Web3Api

Class representing Web3 functionalities.

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

Function

Description

Behavior(options)

Color(target, key)

Component(options)

Folder(label, opts)

Use this decorator to group multiple params into one folder

Param(options)

The @Param decorator can be used on script properties to show them in the property panel of the script on the studio. if no type defined the engine will try to guess the type from it's default value. some Params need to be initialized, please refer to their documentation page

Param(target, key)

Presets(presets)

Receiver(opts)

The @Receiver decorator allows functions to be bound to other component's signals

seconds(secs)

Returns a promise that resolves after a number of seconds has passed

Signal(id, opts)

Trigger(opts)

The @Trigger decorator can be used on script functions to show a button for it in the property panel

useStore(store)

Interfaces

Interface

Description

AbstractParam

AnimationParam

AudioComponentData

Data for the AudioComponent, see ComponentManager.create() on how to create a component

AvatarComponentData

Data specification for AvatarComponent, see ComponentManager.create() on how to create a component

BaseIntersectionEvent

Base interface for all collision/sensor events.

BaseRoomState

BehaviorOptions

BirdComponentData

Data specification for BirdComponent, see ComponentManager.create() on how to create a component

BooleanParam

BoxParamsData

Params for the property

See BoxGeometry (opens in a new tab)

BulletComponentData

Data specification for BulletComponent, see ComponentManager.create() on how to create a component

CloudComponentData

Data specification for CloudComponent, see ComponentManager.create() on how to create a component

CollisionEnterEvent

Payload for the collision enter event; see {@link Component3D.onCollisionEnter()

CollisionExitEvent

Payload for the collision exit event; see {@link Component3D.onCollisionExit()

ColorParam

Component3DData

Base class for all components data interfaces. It contains the common properties for all components

ComponentOptions

ComponentParam

Component Params need to be initialized using the $Param.Component

ContactPoint

ControlsFactoryOpts

CylinderParamsData

Params for the property

See CylinderGeometry (opens in a new tab)

DustComponentData

Data specification for DustComponent, see ComponentManager.create() on how to create a component

GodrayComponentData

Data specification for GodrayComponent, see ComponentManager.create() on how to create a component

GroupParam

Group Params need to be initialized

ImageComponentData

Data specification for ImageComponent, see ComponentManager.create() on how to create a component

JoinRoomOpts

KitbashComponentData

Data specification for KitBashComponent, see ComponentManager.create() on how to create a component

MagneticFieldComponentData

Data specification for MagneticFieldComponent, see ComponentManager.create() on how to create a component

MeshComponentData

Data specification for MeshComponent, see ComponentManager.create() on how to create a component

MeshGeometryData

Geometry data for the MeshComponentData.geometry property

ModelComponentData

Data specification for ModelComponent, see ComponentManager.create() on how to create a component

NumberParam

PCActions

PCJumpParams

PCRunParams

PhysicsData

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

See Component3DData.collider

PlatformComponentData

Data specification for PlatformComponent, see ComponentManager.create() on how to create a component

PlatformerControlsWrapperParams

PlayerAvatarOpts

PlayerData

PrefabResourceData

PresetOptions

ProxyEmitter

ReceiverOptions

ResourceData

ResourceParam

Resource Params need to be initialized using $Param.Resource

ScriptData

Attach an identifier or a tag to a component, so that it can be easily accessed in the ComponentManager.byId() or ComponentManager.byTag() methods

SelectParam

SensorEvent

SignalOptions

SphereParamsData

Params for the property

See SphereGeometry (opens in a new tab)

StringParam

TextComponentData

Data specification for TextComponent, see ComponentManager.create() on how to create a component

ThirdPersonCameraControlsWrapperParams

TriggerOptions

Vec2Param

Vec3Param

VideoComponentData

Data specification for VideoComponent, see ComponentManager.create() on how to create a component

WaveComponentData

Data specification for WaveComponent, see ComponentManager.create() on how to create a component

Web3Api

WindComponentData

Data specification for WindComponent, see ComponentManager.create() on how to create a component

XYZ

This is a shared interface used to represent various 3D coordinates in component data (position, rotation, scale ...)

Namespaces

Namespace

Description

Materials

Plugins

Utils

Variables

Variable

Description

$Param

Alert

Camera

Current camera instance, cf MainCamera for more info

CANVAS

Components

Component manager for the current space, cf ComponentManager for more info

Config

Controls

Use 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

Env

Provides access to the current script execution environment

Events

An object containing all the events that can listened from scripting.

Formats

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

GameStorage

The GameStorage instance is used to store and retrieve data from the game storage.

OOOBjects

Object containing helpers for creating meshes and materials in accordance with the internal pipeline of the engine

OOUI

Page

PARAM_KEY

Physics

Physics manager for the current space, cf PhysicsRapierWrapper for more info

Player

Represents the main player entity on the game; cf PlayerWrapper for more info

Players

Gives access to all player entities on the game; cd for more info

SHARED

UI

UIApis

Web3

Class representing Web3 functionalities.

World

Current space hosting the game, cf Space for more info

Type Aliases

Type Alias

Description

ColliderType

ComponentTypes

ContractOf

ControlsParams

ControlsType

Getter

ParamOptions

RigidBodyType

ScriptParam