Package Exports
- @theatrejs/plugin-aseprite
- @theatrejs/plugin-aseprite/sources/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@theatrejs/plugin-aseprite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Aseprite Plugin
🛠️ A Plugin for Aseprite exported files.
Installation
npm install @theatrejs/plugin-aseprite --save
Quick Start
⚠️ This example does not include the preloading of assets.
import {Stage} from '@theatrejs/theatrejs';
import * as PLUGINASEPRITE from '@theatrejs/plugin-aseprite';
import asepriteDataHero from './hero-16x16.json';
import asepriteTextureHero from './hero-16x16.png';
const asepriteHero = new PLUGINASEPRITE.Aseprite(asepriteTextureHero, asepriteDataHero);
class Level1 extends Stage {
onCreate() {
this.createActor(
PLUGINASEPRITE.FACTORIES.ActorWithSpritesheet({
$aseprite: asepriteHero,
$loop: true,
$tag: 'idle'
})
);
}
}
With Preloading
import {FACTORIES} from '@theatrejs/theatrejs';
import * as PLUGINASEPRITE from '@theatrejs/plugin-aseprite';
import asepriteDataHero from './hero-16x16.json';
import asepriteTextureHero from './hero-16x16.png';
const asepriteHero = new PLUGINASEPRITE.Aseprite(asepriteTextureHero, asepriteDataHero);
class Level1 extends FACTORIES.StageWithPreloadables([PLUGINASEPRITE.FACTORIES.PreloadableAseprite(asepriteHero)]) {
onCreate() {
this.createActor(
PLUGINASEPRITE.FACTORIES.ActorWithSpritesheet({
$aseprite: asepriteHero,
$loop: true,
$tag: 'idle'
})
);
}
}