WL

.Alignment: enum 

Alignment type enum for TextComponent.

Properties

NameTypeDefaultDescription
Center11Text center is at object origin
Left00Text start is at object origin
Right22Text end is at object origin

.AnimationState: enum 

Animation state of AnimationComponent.

Properties

NameTypeDefaultDescription
Paused11Animation is paused and will continue at current playback time on play
Playing00Animation is currently playing
Stopped22Animation is stopped

.Collider: enum 

Collider type enum for CollisionComponent.

Properties

NameTypeDefaultDescription
AxisAlignedBox11Axis Aligned Bounding Box Collider: Box that is always aligned to XYZ axis. It cannot be rotated but is more efficient than Box.
Box22Aligned Bounding Box Collider: Box that matches the object’s rotation and translation correctly. This is the least efficient collider and should only be chosen over Sphere and AxisAlignedBox if really necessary.
Sphere00Sphere Collider: Simplest and most performant collision shape. If this type is set on a CollisionComponent, only the first component of extents will be used to determine the radius.

.CollisionEventType: enum 

Collision callback event type.

Properties

NameTypeDefaultDescription
Touch00Touch/contact detected, collision
TouchLost11Touch/contact lost, uncollide
TriggerTouch22Touch/contact with trigger detected
TriggerTouchLost33Touch/contact with trigger lost

.ForceMode: enum 

Rigid body force mode for addForce and addTorque.

PhysX API Reference

Properties

NameTypeDefaultDescription
Acceleration33Apply as mass dependent force
Force00Apply as force
Impulse11Apply as impulse
VelocityChange22Apply as velocity change, mass dependent

.InputType: enum 

Input type enum for InputComponent.

Properties

NameTypeDefaultDescription
ControllerLeft33Left controller input
ControllerRight44Right controller input
EyeLeft11Left eye input
EyeRight22Right eye input
Head00Head input
RayLeft55Left ray input
RayRight66Right ray input

.Justification: enum 

Justification type enum for TextComponent.

Properties

NameTypeDefaultDescription
Bottom33Text bottom is at object origin
Line00Text line is at object origin
Middle11Text middle is at object origin
Top22Text top is at object origin

.LightType: enum 

Light type enum for LightComponent.

Properties

NameTypeDefaultDescription
Point00Point light
Spot11Spot light
Sun22Sun light / Directional light

.LockAxis: enum 

Enum for Physics axes locking

See angularLockAxis and linearLockAxis.

Properties

NameTypeDefaultDescription
None00No axis selected.
X11X axis:
Y22Y axis:
Z44Z axis:

.LogLevel: enum 

Logging levels supported by Logger.

Properties

NameTypeDefaultDescription
Error22
Info00
Warn11

.LogTag: enum 

Default set of logging tags used by the API.

Properties

NameTypeDefaultDescription
Component22Component init, update, etc…
Engine00Initialization, component registration, etc…
Scene11Scene loading

.MaterialParamType: enum 

Material parameter type.

Properties

NameTypeDefaultDescription
Float22Float parameter type.
Font44Font resource parameter type. Note: Changing font isn’t exposed yet and will raise an error.
Int11Integer parameter type.
Sampler33Sampler resource parameter type, i.e., a Texture.
UnsignedInt00Unsigned integer parameter type.

.MeshAttribute: enum 

0.8.5+

Mesh attribute enum.

Properties

NameTypeDefaultDescription
Color44Color attribute, 4 floats, RGBA, range 0 to 1
JointId55Joint id attribute, 8 unsigned ints
JointWeight66Joint weights attribute, 8 floats
Normal22Normal attribute, 3 floats
Position00Position attribute, 3 floats
Tangent11Tangent attribute, 4 floats
TextureCoordinate33Texture coordinate attribute, 2 floats

.MeshIndexType: enum 

Mesh index type.

Properties

NameTypeDefaultDescription
UnsignedByte11Single byte mesh index, range 0-255
UnsignedInt44Four byte mesh index, range 0-4294967295
UnsignedShort22Two byte mesh index, range 0-65535

.MeshSkinningType: enum 

Mesh skinning type.

Properties

NameTypeDefaultDescription
EightJoints22Skinned, 8 joints/weight per vertex
FourJoints11Skinned, 4 joints/weight per vertex
None00Not skinned

.Shape: enum 

Rigid body shape.

PhysX SDK Guide.

Properties

NameTypeDefaultDescription
Box33Box shape.
Capsule22Capsule shape.
ConvexMesh55Convex mesh shape.
None00No shape.
Plane44Plane shape.
Sphere11Sphere shape.
TriangleMesh66Triangle mesh shape.

.TextEffect: enum 

Effect type enum for TextComponent.

Properties

NameTypeDefaultDescription
None00Text is rendered normally
Outline11Text is rendered with an outline

.Type: enum 

Component property type.

Properties

NameTypeDefaultDescription
Animation10241024Animation reference: Appears in the editor as an animation resource selection dropdown. Initial value is null.
Bool22Bool: Appears in the editor as a checkbox. Initial value is false, unless overridden by the default property.
Color40964096Color: Appears in the editor as a color widget. Initial value is [0.0, 0.0, 0.0, 1.0], unless overridden by the default property.
Enum3232Enumeration: Appears in the editor as a dropdown with given values. The additional values parameter with selection options is mandatory. The property value is resolved to an index into the values array. Initial value is the first element in values, unless overridden by the default property. The default value can be a string or an index into values. Example: js camera: {type: Type.Enum, values: ['auto', 'back', 'front'], default: 'auto'},
Float88Float: Appears in the editor as a floating point input field. Initial value is 0.0, unless overridden by the default property.
Int44Int: Appears in the editor as an integer input field. Initial value is 0, unless overridden by the default property.
Material512512Material reference: Appears in the editor as a material resource selection dropdown. Initial value is null.
Mesh128128Mesh reference: Appears in the editor as a mesh resource selection dropdown. Initial value is null.
Object6464Object reference: Appears in the editor as an object resource selection dropdown with object picker. Initial value is null.
Skin20482048Skin reference: Appears in the editor as a skin resource selection dropdown. Initial value is null.
String1616String / Text: Appears in the editor as a single-line text input field. Initial value is an empty string, unless overridden by the default property.
Texture256256Texture reference: Appears in the editor as a texture resource selection dropdown. Initial value is null.

.APIVersion: Version 

Version of this API.

.DestroyedComponentInstance: { _ } 

Proxy used to override prototypes of destroyed components.

.DestroyedObjectInstance: { _ } 

Proxy used to override prototypes of destroyed objects.

.DestroyedTextureInstance: { _ } 

Proxy used to override prototypes of destroyed textures.

.Property: { (opts: PropertyReferenceOptions) ⇒ ComponentProperty; (defaultValue: boolean) ⇒ ComponentProperty; (r: number, g: number, b: number, a: number) ⇒ ComponentProperty; (values: string[], defaultValue: string | number) ⇒ ComponentProperty; (defaultValue: number) ⇒ ComponentProperty; (defaultValue: number) ⇒ ComponentProperty; (opts: PropertyReferenceOptions) ⇒ ComponentProperty; (opts: PropertyReferenceOptions) ⇒ ComponentProperty; (opts: PropertyReferenceOptions) ⇒ ComponentProperty; (opts: PropertyReferenceOptions) ⇒ ComponentProperty; (defaultValue: string) ⇒ ComponentProperty; (opts: PropertyReferenceOptions) ⇒ ComponentProperty; } 

Component property namespace.

Usage:

 1import {Component, Property} from '@wonderlandengine/api';
 2
 3class MyComponent extends Component {
 4    static Properties = {
 5        myBool: Property.bool(true),
 6        myInt: Property.int(42),
 7        myString: Property.string('Hello World!'),
 8        myMesh: Property.mesh(),
 9    }
10}

For TypeScript users, you can use the decorators instead.

.checkRuntimeCompatibility(version: Version) ⇒ void 

Ensures that this API is compatible with the given runtime version.

We only enforce compatibility for major and minor components, i.e., the runtime and the API must both be of the form x.y.*.

Throws: If the major or the minor components are different.

ParamTypeDescription
versionVersionThe target version

.loadRuntime(runtime: string, options: Partial<LoadRuntimeOptions>) ⇒ Promise<WonderlandEngine

Load the runtime using the WASM and JS files.

Returns: A promise that resolves when the engine is ready to be used.

ParamTypeDescription
runtimestringThe runtime base string, e.g,: WonderlandRuntime-loader-physx.
optionsPartial<LoadRuntimeOptions>Options to modify the loading behaviour.