-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: include format of image file in spritesheet json file's name
- Loading branch information
1 parent
38e872a
commit 50337ec
Showing
3 changed files
with
44 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,8 +166,8 @@ describe('Manifest', () => | |
{ | ||
alias: ['bundle/tps/tps-1.json'], | ||
src: [ | ||
'bundle/tps/[email protected]', | ||
'bundle/tps/[email protected]', | ||
'bundle/tps/tps-1@1x.png.json', | ||
'bundle/tps/[email protected].png.json', | ||
], | ||
data: { | ||
tags: { | ||
|
@@ -179,8 +179,8 @@ describe('Manifest', () => | |
{ | ||
alias: ['bundle/tps/tps-0.json'], | ||
src: [ | ||
'bundle/tps/[email protected]', | ||
'bundle/tps/[email protected]', | ||
'bundle/tps/tps-0@1x.png.json', | ||
'bundle/tps/[email protected].png.json', | ||
], | ||
data: { | ||
tags: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
const sheet1 = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet1 = readJSONSync(`${outputDir}/sprites/sprites@1x.png.json`); | ||
|
||
const expectedSize = { | ||
w: 560, | ||
|
@@ -66,7 +66,7 @@ describe('Texture Packer', () => | |
|
||
expect(sheet1.meta.size).toEqual(expectedSize); | ||
|
||
const sheet2Exists = existsSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet2Exists = existsSync(`${outputDir}/sprites/sprites-1@1x.png.json`); | ||
|
||
expect(sheet2Exists).toBe(false); | ||
}); | ||
|
@@ -95,8 +95,8 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
const sheet1 = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet2 = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet1 = readJSONSync(`${outputDir}/sprites/sprites-0@1x.png.json`); | ||
const sheet2 = readJSONSync(`${outputDir}/sprites/sprites-1@1x.png.json`); | ||
|
||
expect(sheet1.meta.size.w).toBeLessThanOrEqual(size); | ||
expect(sheet1.meta.size.h).toBeLessThanOrEqual(size); | ||
|
@@ -130,7 +130,7 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
const json = existsSync(`${outputDir}/sprites/[email protected]`); | ||
const json = existsSync(`${outputDir}/sprites/something@1x.png.json`); | ||
const png = existsSync(`${outputDir}/sprites/[email protected]`); | ||
|
||
expect(png).toBe(true); | ||
|
@@ -159,16 +159,16 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
expect(existsSync(`${outputDir}/sprites/[email protected]`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/[email protected]`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/[email protected]`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/[email protected].png.json`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/sprites@1x.png.json`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/sprites@2x.png.json`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/[email protected]`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/[email protected]`)).toBe(true); | ||
expect(existsSync(`${outputDir}/sprites/[email protected]`)).toBe(true); | ||
|
||
const sheet1Data = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet2Data = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet3Data = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet1Data = readJSONSync(`${outputDir}/sprites/sprites@1x.png.json`); | ||
const sheet2Data = readJSONSync(`${outputDir}/sprites/sprites@2x.png.json`); | ||
const sheet3Data = readJSONSync(`${outputDir}/sprites/[email protected].png.json`); | ||
|
||
expect(sheet2Data.frames['sprite0.png'].frame).toEqual({ x: 2, y: 2, w: 136, h: 196 }); | ||
expect(sheet2Data.meta.size).toEqual({ w: 560, h: 480 }); | ||
|
@@ -241,7 +241,7 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
const sheet1 = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet1 = readJSONSync(`${outputDir}/sprites/sprites@1x.png.json`); | ||
|
||
const expectedSize = { | ||
w: 560, | ||
|
@@ -250,7 +250,7 @@ describe('Texture Packer', () => | |
|
||
expect(sheet1.meta.size).toEqual(expectedSize); | ||
|
||
const sheet2Exists = existsSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet2Exists = existsSync(`${outputDir}/sprites/sprites-1@1x.png.json`); | ||
|
||
expect(sheet2Exists).toBe(false); | ||
}); | ||
|
@@ -273,8 +273,8 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
const sheet1 = existsSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet2 = existsSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet1 = existsSync(`${outputDir}/sprites/sprites@1x.png.json`); | ||
const sheet2 = existsSync(`${outputDir}/sprites/[email protected].png.json`); | ||
|
||
expect(sheet1).toBe(true); | ||
expect(sheet2).toBe(true); | ||
|
@@ -285,7 +285,7 @@ describe('Texture Packer', () => | |
h: 480 / 2, | ||
}; | ||
|
||
const sheetJson = readJSONSync(`${outputDir}/sprites/[email protected]`); | ||
const sheetJson = readJSONSync(`${outputDir}/sprites/[email protected].png.json`); | ||
|
||
expect(sheetJson.meta.size).toEqual(expectedSize); | ||
}); | ||
|
@@ -336,9 +336,9 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
const sheet1 = existsSync(`${outputDir}/sprites/sprites/[email protected]`); | ||
const sheet2 = existsSync(`${outputDir}/sprites/sprites/[email protected]`); | ||
const sheet3 = existsSync(`${outputDir}/sprites/sprites/[email protected]`); | ||
const sheet1 = existsSync(`${outputDir}/sprites/sprites/sprites@1x.png.json`); | ||
const sheet2 = existsSync(`${outputDir}/sprites/sprites/[email protected].png.json`); | ||
const sheet3 = existsSync(`${outputDir}/sprites/sprites/sprites@2x.png.json`); | ||
|
||
expect(sheet1).toBe(true); | ||
expect(sheet2).toBe(false); | ||
|
@@ -385,7 +385,7 @@ describe('Texture Packer', () => | |
|
||
await assetpack.run(); | ||
|
||
const sheet1 = existsSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet1 = existsSync(`${outputDir}/sprites/sprites@1x.jpg.json`); | ||
const sheet2 = existsSync(`${outputDir}/sprites/[email protected]`); | ||
const sheet3 = existsSync(`${outputDir}/sprites/[email protected]`); | ||
|
||
|