Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/excaliburjs/sample-material. Excalibur Material & PostProcessor Shader Samples excaliburjs.com/sample-material
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940import { DefaultLoader, Engine, ExcaliburGraphicsContext, Scene, SceneActivationContext } from "excalibur";import { Player } from "./player";
export class MyLevel extends Scene { override onInitialize(engine: Engine): void { // Scene.onInitialize is where we recommend you perform the composition for your game const player = new Player(); this.add(player); // Actors need to be added to a scene to be drawn }
override onPreLoad(loader: DefaultLoader): void { // Add any scene specific resources to load }
override onActivate(context: SceneActivationContext<unknown>): void { // Called when Excalibur transitions to this scene // Only 1 scene is active at a time }
override onDeactivate(context: SceneActivationContext): void { // Called when Excalibur transitions away from this scene // Only 1 scene is active at a time }
override onPreUpdate(engine: Engine, elapsedMs: number): void { // Called before anything updates in the scene }
override onPostUpdate(engine: Engine, elapsedMs: number): void { // Called after everything updates in the scene }
override onPreDraw(ctx: ExcaliburGraphicsContext, elapsedMs: number): void { // Called before Excalibur draws to the screen }
override onPostDraw(ctx: ExcaliburGraphicsContext, elapsedMs: number): void { // Called after Excalibur draws to the screen }}