class World
extends WebGLCanvas
import { World } from "https://deno.land/x/caviar@2.6.9/src/World.ts";
Constructors
new
World(params: CreateWindowOptions, scenes: Array<Scene>)Properties
currentScene: Scene
Current scene displayed
keyManager: KeyManager
Manages Key Events
params: CreateWindowOptions
Window parameters
renderer: WebGLRenderer2D
The WebGl renderer that powers the engine
Methods
Disables the caviar launch banner
keyDown(e: WindowKeyboardEvent): boolean
Checks if a key is currently down
loadPlugin(name: string, plugin: any): void
Adds a plugin to the game
setBackground(color: string | RGBA): void
Sets the background to the given color
setFPS(fps: number): void
Sets the amount of Frames to render per second
setScene(id: number): void
Sets the current scene to the specified scene index
setScene(name: string): void
Sets the current scene to the specified scene with the given name
setup(): void
Sets up the current scene
start(): Promise<void>
Launches the World
updateProgramLifeCycle(): void
Updates the program's life cycle
usePlugin(name: string): any
Uses an loaded plugin to the game
[_draw](): void
[_fps](): () => void
[_mouseDown](e: any): void
[_mouseMotion](e: MouseMotionEvent): void