@theatrejs/loader-aseprite 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -16
  2. package/package.json +11 -2
package/README.md CHANGED
@@ -45,16 +45,20 @@ npm install @theatrejs/loader-aseprite --save-dev
45
45
  > *⚠️ This example does not include the preloading of assets.*
46
46
 
47
47
  ```javascript
48
- import {Actor} from '@theatrejs/theatrejs';
48
+ import {Stage} from '@theatrejs/theatrejs';
49
+ import * as PLUGINASEPRITE from '@theatrejs/plugin-aseprite';
49
50
 
50
- import spritesheetHero from './hero-16x16.aseprite';
51
+ import asepriteHero from './hero-16x16.aseprite';
51
52
 
52
- class Hero extends Actor {
53
+ class Level1 extends Stage {
53
54
  onCreate() {
54
- this.$timeline = spritesheetHero.createTimeline({$actor: this, $framerate: 8, $loop: true, $tag: 'idle'});
55
- }
56
- onTick($timetick) {
57
- this.$timeline.tick($timetick);
55
+ this.createActor(
56
+ PLUGINASEPRITE.FACTORIES.ActorWithSpritesheet({
57
+ $aseprite: asepriteHero,
58
+ $loop: true,
59
+ $tag: 'idle'
60
+ })
61
+ );
58
62
  }
59
63
  }
60
64
  ```
@@ -63,19 +67,19 @@ class Hero extends Actor {
63
67
 
64
68
  ```javascript
65
69
  import {FACTORIES} from '@theatrejs/theatrejs';
66
-
67
70
  import * as PLUGINASEPRITE from '@theatrejs/plugin-aseprite';
68
71
 
69
- import spritesheetHero from './hero-16x16.aseprite';
72
+ import asepriteHero from './hero-16x16.aseprite';
70
73
 
71
- class Hero extends FACTORIES.ActorWithPreloadables([PLUGINASEPRITE.FACTORIES.PreloadableAseprite(spritesheetHero)]) {
74
+ class Level1 extends FACTORIES.StageWithPreloadables([PLUGINASEPRITE.FACTORIES.PreloadableAseprite(asepriteHero)]) {
72
75
  onCreate() {
73
- this.$timeline = spritesheetHero.createTimeline({$actor: this, $framerate: 8, $loop: true, $tag: 'idle'});
74
- }
75
- onTick($timetick) {
76
- this.$timeline.tick($timetick);
76
+ this.createActor(
77
+ PLUGINASEPRITE.FACTORIES.ActorWithSpritesheet({
78
+ $aseprite: asepriteHero,
79
+ $loop: true,
80
+ $tag: 'idle'
81
+ })
82
+ );
77
83
  }
78
84
  }
79
85
  ```
80
-
81
- ## [API](https://theatrejs.github.io/loader-aseprite/index.html)
package/package.json CHANGED
@@ -2,14 +2,17 @@
2
2
  "author": "Alexandre Blondeau",
3
3
  "description": "⚙️ A Webpack Loader for Aseprite files.",
4
4
  "engines": {
5
+
5
6
  "node": "16.13.0",
6
7
  "npm": "8.1.0"
7
8
  },
8
9
  "files": [
10
+
9
11
  "sources/"
10
12
  ],
11
13
  "homepage": "https://github.com/theatrejs/loader-aseprite",
12
14
  "keywords": [
15
+
13
16
  "2d",
14
17
  "aseprite",
15
18
  "canvas",
@@ -32,13 +35,19 @@
32
35
  "main": "./sources/index.js",
33
36
  "name": "@theatrejs/loader-aseprite",
34
37
  "peerDependencies": {
35
- "@theatrejs/plugin-aseprite": ">= 1.0.0",
38
+
39
+ "@theatrejs/plugin-aseprite": ">= 1.1.0",
36
40
  "webpack": ">= 5.94.0"
37
41
  },
38
42
  "repository": {
43
+
39
44
  "type": "git",
40
45
  "url": "git+https://github.com/theatrejs/loader-aseprite.git"
41
46
  },
47
+ "scripts": {
48
+
49
+ "postversion": "node ./tools/custom/postversion.cjs"
50
+ },
42
51
  "type": "commonjs",
43
- "version": "1.0.0"
52
+ "version": "1.1.0"
44
53
  }