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.
123456789101112131415import { ImageSource, Loader } from "excalibur";
// It is convenient to put your resources in one placeexport const Resources = { Sword: new ImageSource("./images/sword.png") // Vite public/ directory serves the root images} as const; // the 'as const' is a neat typescript trick to get strong typing on your resources. // So when you type Resources.Sword -> ImageSource
// We build a loader and add all of our resources to the boot loader// You can build your own loader by extending DefaultLoaderexport const loader = new Loader();for (const res of Object.values(Resources)) { loader.addResource(res);}