Abstract
Optional
canvas?: string | Canvas | HTMLCanvasElementOptional
userthe shape to add
the shape that was added
class TestScene {
compose() {
const square = this.add(new Square())
}
}
Add an animation to the scene (to be played)
the animation that was added
class TestScene {
compose() {
const square = this.add(new Square())
// Adds the animation
this.add(new FadeIn(square));
}
}
Adds a function to be executed on each tick
Adds a mixture of shapes, animations, and functions to the scene
Rest
...els: SceneElement[]the elements to add to the scene
an array containing the elements that were added
Abstract
composeMethod implemented by subclasses to compose the scene. This is where shapes and animations are added to the scene
class TestScene {
compose() {
// Add in all your shapes and animations here. For example, adding a square and fading it in
const square = this.add(new Square())
// Fade in the square
this.add(new FadeIn(square));
}
}
Add a shape to the scene