@flighthq/spritesheet 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787
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.
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/spritesheet`. The `@
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/spritesheet@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/spritesheet@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/spritesheet)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/spritesheet",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.5.1-next.
|
|
42
|
-
"@flighthq/signals": "0.5.1-next.
|
|
43
|
-
"@flighthq/textureatlas": "0.5.1-next.
|
|
44
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/signals": "0.5.1-next.905.5fbf787",
|
|
43
|
+
"@flighthq/textureatlas": "0.5.1-next.905.5fbf787",
|
|
44
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"typescript": "^5.3.0"
|
package/src/spritesheet.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cloneSpritesheet, createSpritesheet, getSpritesheetAnimation } from './spritesheet';
|
|
1
|
+
import { cloneSpritesheet, createSpritesheet, getSpritesheetAnimation, initializeSpritesheet } from './spritesheet';
|
|
2
2
|
import { createSpritesheetAnimation } from './spritesheetAnimation';
|
|
3
3
|
import { createSpritesheetFrame } from './spritesheetFrame';
|
|
4
4
|
|
|
@@ -59,3 +59,8 @@ describe('getSpritesheetAnimation', () => {
|
|
|
59
59
|
expect(getSpritesheetAnimation(sheet, 'walk')).toBe(walk);
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
|
+
describe('initializeSpritesheet', () => {
|
|
63
|
+
it('is the construction initializer of createSpritesheet', () => {
|
|
64
|
+
expect(typeof initializeSpritesheet).toBe('function');
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { createTextureAtlas, createTextureAtlasRegion } from '@flighthq/textureatlas/contract';
|
|
2
2
|
|
|
3
3
|
import { createSpritesheet } from './spritesheet';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createSpritesheetAnimation,
|
|
6
|
+
createSpritesheetAnimationFromFrameNames,
|
|
7
|
+
initializeSpritesheetAnimation,
|
|
8
|
+
} from './spritesheetAnimation';
|
|
5
9
|
import { createSpritesheetFrame } from './spritesheetFrame';
|
|
6
10
|
|
|
7
11
|
describe('createSpritesheetAnimation', () => {
|
|
@@ -126,3 +130,8 @@ describe('createSpritesheetAnimationFromFrameNames', () => {
|
|
|
126
130
|
expect(anim!.frames).toEqual([0, 1, 2]);
|
|
127
131
|
});
|
|
128
132
|
});
|
|
133
|
+
describe('initializeSpritesheetAnimation', () => {
|
|
134
|
+
it('is the construction initializer of createSpritesheetAnimation', () => {
|
|
135
|
+
expect(typeof initializeSpritesheetAnimation).toBe('function');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createSpritesheetAnimationData,
|
|
3
|
+
createSpritesheetData,
|
|
4
|
+
createSpritesheetFrameData,
|
|
5
|
+
initializeSpritesheetAnimationData,
|
|
6
|
+
initializeSpritesheetData,
|
|
7
|
+
initializeSpritesheetFrameData,
|
|
8
|
+
} from './spritesheetData';
|
|
2
9
|
|
|
3
10
|
describe('createSpritesheetAnimationData', () => {
|
|
4
11
|
it('creates with all defaults when no argument is passed', () => {
|
|
@@ -147,3 +154,20 @@ describe('createSpritesheetFrameData', () => {
|
|
|
147
154
|
expect(frame.pivotY).toBeNull();
|
|
148
155
|
});
|
|
149
156
|
});
|
|
157
|
+
describe('initializeSpritesheetAnimationData', () => {
|
|
158
|
+
it('is the construction initializer of createSpritesheetAnimationData', () => {
|
|
159
|
+
expect(typeof initializeSpritesheetAnimationData).toBe('function');
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
describe('initializeSpritesheetData', () => {
|
|
164
|
+
it('is the construction initializer of createSpritesheetData', () => {
|
|
165
|
+
expect(typeof initializeSpritesheetData).toBe('function');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
describe('initializeSpritesheetFrameData', () => {
|
|
170
|
+
it('is the construction initializer of createSpritesheetFrameData', () => {
|
|
171
|
+
expect(typeof initializeSpritesheetFrameData).toBe('function');
|
|
172
|
+
});
|
|
173
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createSpritesheetFrame } from './spritesheetFrame';
|
|
1
|
+
import { createSpritesheetFrame, initializeSpritesheetFrame } from './spritesheetFrame';
|
|
2
2
|
|
|
3
3
|
describe('createSpritesheetFrame', () => {
|
|
4
4
|
it('initializes default values', () => {
|
|
@@ -48,3 +48,8 @@ describe('createSpritesheetFrame', () => {
|
|
|
48
48
|
expect(a).not.toBe(b);
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
|
+
describe('initializeSpritesheetFrame', () => {
|
|
52
|
+
it('is the construction initializer of createSpritesheetFrame', () => {
|
|
53
|
+
expect(typeof initializeSpritesheetFrame).toBe('function');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
disposeSpritesheetPlayer,
|
|
11
11
|
getSpritesheetPlayerFrame,
|
|
12
12
|
getSpritesheetPlayerFrameAt,
|
|
13
|
+
initializeSpritesheetPlayer,
|
|
13
14
|
pauseSpritesheetPlayer,
|
|
14
15
|
playSpritesheetAnimation,
|
|
15
16
|
queueSpritesheetAnimation,
|
|
@@ -236,6 +237,12 @@ describe('getSpritesheetPlayerFrameAt', () => {
|
|
|
236
237
|
});
|
|
237
238
|
});
|
|
238
239
|
|
|
240
|
+
describe('initializeSpritesheetPlayer', () => {
|
|
241
|
+
it('is the construction initializer of createSpritesheetPlayer', () => {
|
|
242
|
+
expect(typeof initializeSpritesheetPlayer).toBe('function');
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
239
246
|
describe('pauseSpritesheetPlayer', () => {
|
|
240
247
|
it('sets paused to true', () => {
|
|
241
248
|
const player = createSpritesheetPlayer();
|
|
@@ -474,7 +481,6 @@ describe('stopSpritesheetPlayer', () => {
|
|
|
474
481
|
expect(player.queue).toHaveLength(0);
|
|
475
482
|
});
|
|
476
483
|
});
|
|
477
|
-
|
|
478
484
|
describe('updateSpritesheetPlayer', () => {
|
|
479
485
|
it('returns false when no animation', () => {
|
|
480
486
|
const player = createSpritesheetPlayer();
|