SceneOptions object passed to initialize the scene
Size of the fps buffer
GPU.js settings
Ambient of the scene
Background color of the scene
Bounds of the scene
Whether or not the bounds are active
Position of the camera
Object to bind the camera to
Canvas of the scene
Whether or not to clear the scene
Collision monitors in the scene
Canvas rendering context of the scene
GPU.js kernel for diffuse lighting
Directional lights in the scene
Draw mode of the scene. "full" is defualt and used when objects need to be updated as well. "plain" just draws objects (eg: when the scene is handled on the server)
Fog of the scene
Formatted directional lights for the diffuse kernel
Formatted lights for the diffuse kernel
Buffer that holds the last FPS_BUFFER_SIZE frames rendering times (in ms)
Whether or not to monitor the fps
GPU.js instance
Height of the scene
Unique ID of the scene
Whether or not the scene is the active scene
Whether or not the scene is running on the client
Last frame stamp
Layers of the scene
Whether or not lighting is enabled
Lights in the scene
Whether or not the lights are pre-formatted
Objects in the scene
Whether or not the scene is ready to draw
Update function of the scene (called every frame)
Width of the scene
Used to add lights to the scene
Light to add to the scene (can be either a Light or DirectionalLight)
Adds the specified GameObject to the scene
GameObject to add to the scene
Optional
layerID: stringBinds the scene's camera to a GameObject
GameObject to bind the scene's camera to
Moves the camera to a GameObject
GameObject to move the camera to
Reloads scene objects from the passed list, used for multiplayer when objects are handled on the server
Objects to draw from
Enables collisions between the specified objects Adds a CollisionMonitor to the scene
First object to check for collisions
Second object to check for collisions
Function that runs when the objects collide (called once)
Function that runs when the objects separate (called once)
Optional
options: CollisionMonitorOptionsOptions for the collision monitor
Formats the directional lights into a format that the diffuseKernel can understand Updates the formattedDLights property
List of directional lights in the scene
Optional
cameraAngle: Vec2Moves the scene's camera
Vector to move the scene's camera by
Removes a GameObject from the scene
GameObject to remove from the scene
Sets the boundaries of the scene (eg: where object can move)
How far right (in pixel) can objects in the scene move. If object are initialized outside the bounds, they will not be able to move, unless physics is enabled, in which case they will not be able to enter the scene.
How far down (in pixel) can objects in the scene move. If object are initialized outside the bounds, they will not be able to move, unless physics is enabled, in which case they will not be able to enter the scene.
Boolean, if true, bounds will be active by defualt, if false, bounds will be inactive by default
Configures the scene to draw on the provided canvas
Canvas that the scene will draw on
The canvas rendering context of the scene
The width of the scene
The height of the scene
Used to quickly set up an object as the player. Binds the camera to the object and sets up WASD movement (the object will move movementSpeed
pixels every 10ms)
(Only for sigle-player games)
GameObject to configure as player
How quickly the player should move
Generated using TypeDoc
Classdesc
Scene class, used for building scenes
Example
Example
Example