Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/excaliburjs/sample-html. Example building HTML/CSS/JavaScript UIs w/ Excalibur excaliburjs.com/sample-html
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233import { ImageSource, SpriteSheet, Animation, Loader, FontSource } from "excalibur";
import CalImage from './cal.png'; import SilkscreenFont from './Silkscreen-Regular.ttf';
export const Resources = { CalSpriteSheet: new ImageSource(CalImage), PixelFont: new FontSource(SilkscreenFont, 'silkscreen')} as const;
export const CalSpriteSheet = SpriteSheet.fromImageSource({ image: Resources.CalSpriteSheet, grid: { rows: 1, columns: 9, spriteHeight: 32, spriteWidth: 32 }})
export const IdleAnimation = Animation.fromSpriteSheetCoordinates({ spriteSheet: CalSpriteSheet, frameCoordinates: [ { x: 2, y: 0}, { x: 3, y: 0}, ], durationPerFrameMs: 300});
export const loader = new Loader();for (let res of Object.values(Resources)) { loader.addResource(res);}