Gathering detailed insights and metrics for @sjchang/sprite-packer
Gathering detailed insights and metrics for @sjchang/sprite-packer
Gathering detailed insights and metrics for @sjchang/sprite-packer
Gathering detailed insights and metrics for @sjchang/sprite-packer
npm install @sjchang/sprite-packer
Typescript
Module System
Node Version
NPM Version
TypeScript (82.19%)
JavaScript (17.81%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
8 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 10, 2023
Latest Version
1.0.3
Package Id
@sjchang/sprite-packer@1.0.3
Unpacked Size
51.71 kB
Size
10.92 kB
File Count
29
NPM Version
8.1.0
Node Version
16.13.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
npm i -g @sjchang/sprite-packer
1$ spritepacker --help 2Options: 3 -f, --file Set input images path, support glob [string] [required] 4 -w, --maxWidth Set output image max width [number] [default: 2048] 5 -h, --maxHeight Set output image max height [number] [default: 2048] 6 --format Set output file type 7 [string] [choices: "JsonArray", "JsonHash", "css", "plist"] [default: 8 "JsonArray"] 9 -o, --outDir Set output file dir [string] [default: "./"] 10 -n, --name Set output file name [string] [default: "spritesheet"] 11 --frameName, --fn Set frame name [string] [default: "[dir][name][ext]"] 12 -b, --border Set image border [number] [default: 1] 13 -p, --padding Set frames spacing [number] [default: 1] 14 -s, --sep Set file separator [string] [default: "/"] 15 --trim Remove transparent pixels [boolean] [default: false] 16 -v, --version Show version number [boolean] 17 --help Show help [boolean] 18 19Examples: 20 spritepacker -f "./*.png"
1$ spritepacker -f "./.test/image/**/*.png" -n icons -o ./.test
$ tree ./.test/image/
./.test/image/
├── ban.png
├── endLine.png
├── fruits
│ ├── 10.png
│ ├── 11.png
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ └── 9.png
├── gameover.png
├── ground.png
├── light.png
├── no.png
├── p1.png
├── p5.png
├── pao.png
├── tryagain.png
└── yes.png
Support phaser...
1{ 2 "frames": [ 3 { 4 "filename": "ground.png", 5 "trimmed": false, 6 "sourceSize": { "w": 720, "h": 127 }, 7 "spriteSourceSize": { "x": 0, "y": 0, "w": 720, "h": 127 }, 8 "frame": { "x": 1, "y": 1, "w": 720, "h": 127 } 9 }, 10 { 11 "filename": "endLine.png", 12 "trimmed": false, 13 "sourceSize": { "w": 711, "h": 8 }, 14 "spriteSourceSize": { "x": 0, "y": 0, "w": 711, "h": 8 }, 15 "frame": { "x": 1, "y": 129, "w": 711, "h": 8 } 16 }, 17 { 18 "filename": "tryagain.png", 19 "trimmed": false, 20 "sourceSize": { "w": 533, "h": 90 }, 21 "spriteSourceSize": { "x": 0, "y": 0, "w": 533, "h": 90 }, 22 "frame": { "x": 1, "y": 138, "w": 533, "h": 90 } 23 }, 24 { 25 "filename": "fruits/11.png", 26 "trimmed": false, 27 "sourceSize": { "w": 408, "h": 408 }, 28 "spriteSourceSize": { "x": 0, "y": 0, "w": 408, "h": 408 }, 29 "frame": { "x": 1, "y": 229, "w": 408, "h": 408 } 30 }, 31 { 32 "filename": "gameover.png", 33 "trimmed": false, 34 "sourceSize": { "w": 358, "h": 247 }, 35 "spriteSourceSize": { "x": 0, "y": 0, "w": 358, "h": 247 }, 36 "frame": { "x": 1, "y": 638, "w": 358, "h": 247 } 37 }, 38 { 39 "filename": "p1.png", 40 "trimmed": false, 41 "sourceSize": { "w": 319, "h": 292 }, 42 "spriteSourceSize": { "x": 0, "y": 0, "w": 319, "h": 292 }, 43 "frame": { "x": 722, "y": 1, "w": 319, "h": 292 } 44 }, 45 { 46 "filename": "p5.png", 47 "trimmed": false, 48 "sourceSize": { "w": 319, "h": 292 }, 49 "spriteSourceSize": { "x": 0, "y": 0, "w": 319, "h": 292 }, 50 "frame": { "x": 410, "y": 294, "w": 319, "h": 292 } 51 }, 52 { 53 "filename": "fruits/10.png", 54 "trimmed": false, 55 "sourceSize": { "w": 308, "h": 309 }, 56 "spriteSourceSize": { "x": 0, "y": 0, "w": 308, "h": 309 }, 57 "frame": { "x": 730, "y": 294, "w": 308, "h": 309 } 58 }, 59 { 60 "filename": "fruits/9.png", 61 "trimmed": false, 62 "sourceSize": { "w": 308, "h": 308 }, 63 "spriteSourceSize": { "x": 0, "y": 0, "w": 308, "h": 308 }, 64 "frame": { "x": 1, "y": 886, "w": 308, "h": 308 } 65 }, 66 { 67 "filename": "fruits/8.png", 68 "trimmed": false, 69 "sourceSize": { "w": 258, "h": 258 }, 70 "spriteSourceSize": { "x": 0, "y": 0, "w": 258, "h": 258 }, 71 "frame": { "x": 310, "y": 886, "w": 258, "h": 258 } 72 }, 73 { 74 "filename": "light.png", 75 "trimmed": false, 76 "sourceSize": { "w": 256, "h": 256 }, 77 "spriteSourceSize": { "x": 0, "y": 0, "w": 256, "h": 256 }, 78 "frame": { "x": 410, "y": 604, "w": 256, "h": 256 } 79 }, 80 { 81 "filename": "fruits/7.png", 82 "trimmed": false, 83 "sourceSize": { "w": 193, "h": 193 }, 84 "spriteSourceSize": { "x": 0, "y": 0, "w": 193, "h": 193 }, 85 "frame": { "x": 569, "y": 861, "w": 193, "h": 193 } 86 }, 87 { 88 "filename": "fruits/6.png", 89 "trimmed": false, 90 "sourceSize": { "w": 183, "h": 183 }, 91 "spriteSourceSize": { "x": 0, "y": 0, "w": 183, "h": 183 }, 92 "frame": { "x": 667, "y": 604, "w": 183, "h": 183 } 93 }, 94 { 95 "filename": "yes.png", 96 "trimmed": false, 97 "sourceSize": { "w": 182, "h": 89 }, 98 "spriteSourceSize": { "x": 0, "y": 0, "w": 182, "h": 89 }, 99 "frame": { "x": 535, "y": 138, "w": 182, "h": 89 } 100 }, 101 { 102 "filename": "fruits/5.png", 103 "trimmed": false, 104 "sourceSize": { "w": 153, "h": 152 }, 105 "spriteSourceSize": { "x": 0, "y": 0, "w": 153, "h": 152 }, 106 "frame": { "x": 851, "y": 604, "w": 153, "h": 152 } 107 }, 108 { 109 "filename": "no.png", 110 "trimmed": false, 111 "sourceSize": { "w": 127, "h": 89 }, 112 "spriteSourceSize": { "x": 0, "y": 0, "w": 127, "h": 89 }, 113 "frame": { "x": 569, "y": 1055, "w": 127, "h": 89 } 114 }, 115 { 116 "filename": "fruits/4.png", 117 "trimmed": false, 118 "sourceSize": { "w": 119, "h": 119 }, 119 "spriteSourceSize": { "x": 0, "y": 0, "w": 119, "h": 119 }, 120 "frame": { "x": 697, "y": 1055, "w": 119, "h": 119 } 121 }, 122 { 123 "filename": "fruits/3.png", 124 "trimmed": false, 125 "sourceSize": { "w": 108, "h": 108 }, 126 "spriteSourceSize": { "x": 0, "y": 0, "w": 108, "h": 108 }, 127 "frame": { "x": 851, "y": 757, "w": 108, "h": 108 } 128 }, 129 { 130 "filename": "fruits/2.png", 131 "trimmed": false, 132 "sourceSize": { "w": 80, "h": 80 }, 133 "spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 80 }, 134 "frame": { "x": 960, "y": 757, "w": 80, "h": 80 } 135 }, 136 { 137 "filename": "fruits/1.png", 138 "trimmed": false, 139 "sourceSize": { "w": 52, "h": 52 }, 140 "spriteSourceSize": { "x": 0, "y": 0, "w": 52, "h": 52 }, 141 "frame": { "x": 410, "y": 229, "w": 52, "h": 52 } 142 }, 143 { 144 "filename": "ban.png", 145 "trimmed": false, 146 "sourceSize": { "w": 24, "h": 41 }, 147 "spriteSourceSize": { "x": 0, "y": 0, "w": 24, "h": 41 }, 148 "frame": { "x": 310, "y": 1145, "w": 24, "h": 41 } 149 }, 150 { 151 "filename": "pao.png", 152 "trimmed": false, 153 "sourceSize": { "w": 38, "h": 40 }, 154 "spriteSourceSize": { "x": 0, "y": 0, "w": 38, "h": 40 }, 155 "frame": { "x": 335, "y": 1145, "w": 38, "h": 40 } 156 } 157 ] 158}
Support phaser...
1$ spritepacker -f "./.test/image/**/*.png" -n icons -o ./.test --format JsonHash --frameName [dir][name]
1{ 2 "frames": { 3 "ground": { 4 "trimmed": false, 5 "sourceSize": { "w": 720, "h": 127 }, 6 "spriteSourceSize": { "x": 0, "y": 0, "w": 720, "h": 127 }, 7 "frame": { "x": 1, "y": 1, "w": 720, "h": 127 } 8 }, 9 "endLine": { 10 "trimmed": false, 11 "sourceSize": { "w": 711, "h": 8 }, 12 "spriteSourceSize": { "x": 0, "y": 0, "w": 711, "h": 8 }, 13 "frame": { "x": 1, "y": 129, "w": 711, "h": 8 } 14 }, 15 "tryagain": { 16 "trimmed": false, 17 "sourceSize": { "w": 533, "h": 90 }, 18 "spriteSourceSize": { "x": 0, "y": 0, "w": 533, "h": 90 }, 19 "frame": { "x": 1, "y": 138, "w": 533, "h": 90 } 20 }, 21 "fruits/11": { 22 "trimmed": false, 23 "sourceSize": { "w": 408, "h": 408 }, 24 "spriteSourceSize": { "x": 0, "y": 0, "w": 408, "h": 408 }, 25 "frame": { "x": 1, "y": 229, "w": 408, "h": 408 } 26 }, 27 "gameover": { 28 "trimmed": false, 29 "sourceSize": { "w": 358, "h": 247 }, 30 "spriteSourceSize": { "x": 0, "y": 0, "w": 358, "h": 247 }, 31 "frame": { "x": 1, "y": 638, "w": 358, "h": 247 } 32 }, 33 "p1": { 34 "trimmed": false, 35 "sourceSize": { "w": 319, "h": 292 }, 36 "spriteSourceSize": { "x": 0, "y": 0, "w": 319, "h": 292 }, 37 "frame": { "x": 722, "y": 1, "w": 319, "h": 292 } 38 }, 39 "p5": { 40 "trimmed": false, 41 "sourceSize": { "w": 319, "h": 292 }, 42 "spriteSourceSize": { "x": 0, "y": 0, "w": 319, "h": 292 }, 43 "frame": { "x": 410, "y": 294, "w": 319, "h": 292 } 44 }, 45 "fruits/10": { 46 "trimmed": false, 47 "sourceSize": { "w": 308, "h": 309 }, 48 "spriteSourceSize": { "x": 0, "y": 0, "w": 308, "h": 309 }, 49 "frame": { "x": 730, "y": 294, "w": 308, "h": 309 } 50 }, 51 "fruits/9": { 52 "trimmed": false, 53 "sourceSize": { "w": 308, "h": 308 }, 54 "spriteSourceSize": { "x": 0, "y": 0, "w": 308, "h": 308 }, 55 "frame": { "x": 1, "y": 886, "w": 308, "h": 308 } 56 }, 57 "fruits/8": { 58 "trimmed": false, 59 "sourceSize": { "w": 258, "h": 258 }, 60 "spriteSourceSize": { "x": 0, "y": 0, "w": 258, "h": 258 }, 61 "frame": { "x": 310, "y": 886, "w": 258, "h": 258 } 62 }, 63 "light": { 64 "trimmed": false, 65 "sourceSize": { "w": 256, "h": 256 }, 66 "spriteSourceSize": { "x": 0, "y": 0, "w": 256, "h": 256 }, 67 "frame": { "x": 410, "y": 604, "w": 256, "h": 256 } 68 }, 69 "fruits/7": { 70 "trimmed": false, 71 "sourceSize": { "w": 193, "h": 193 }, 72 "spriteSourceSize": { "x": 0, "y": 0, "w": 193, "h": 193 }, 73 "frame": { "x": 569, "y": 861, "w": 193, "h": 193 } 74 }, 75 "fruits/6": { 76 "trimmed": false, 77 "sourceSize": { "w": 183, "h": 183 }, 78 "spriteSourceSize": { "x": 0, "y": 0, "w": 183, "h": 183 }, 79 "frame": { "x": 667, "y": 604, "w": 183, "h": 183 } 80 }, 81 "yes": { 82 "trimmed": false, 83 "sourceSize": { "w": 182, "h": 89 }, 84 "spriteSourceSize": { "x": 0, "y": 0, "w": 182, "h": 89 }, 85 "frame": { "x": 535, "y": 138, "w": 182, "h": 89 } 86 }, 87 "fruits/5": { 88 "trimmed": false, 89 "sourceSize": { "w": 153, "h": 152 }, 90 "spriteSourceSize": { "x": 0, "y": 0, "w": 153, "h": 152 }, 91 "frame": { "x": 851, "y": 604, "w": 153, "h": 152 } 92 }, 93 "no": { 94 "trimmed": false, 95 "sourceSize": { "w": 127, "h": 89 }, 96 "spriteSourceSize": { "x": 0, "y": 0, "w": 127, "h": 89 }, 97 "frame": { "x": 569, "y": 1055, "w": 127, "h": 89 } 98 }, 99 "fruits/4": { 100 "trimmed": false, 101 "sourceSize": { "w": 119, "h": 119 }, 102 "spriteSourceSize": { "x": 0, "y": 0, "w": 119, "h": 119 }, 103 "frame": { "x": 697, "y": 1055, "w": 119, "h": 119 } 104 }, 105 "fruits/3": { 106 "trimmed": false, 107 "sourceSize": { "w": 108, "h": 108 }, 108 "spriteSourceSize": { "x": 0, "y": 0, "w": 108, "h": 108 }, 109 "frame": { "x": 851, "y": 757, "w": 108, "h": 108 } 110 }, 111 "fruits/2": { 112 "trimmed": false, 113 "sourceSize": { "w": 80, "h": 80 }, 114 "spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 80 }, 115 "frame": { "x": 960, "y": 757, "w": 80, "h": 80 } 116 }, 117 "fruits/1": { 118 "trimmed": false, 119 "sourceSize": { "w": 52, "h": 52 }, 120 "spriteSourceSize": { "x": 0, "y": 0, "w": 52, "h": 52 }, 121 "frame": { "x": 410, "y": 229, "w": 52, "h": 52 } 122 }, 123 "ban": { 124 "trimmed": false, 125 "sourceSize": { "w": 24, "h": 41 }, 126 "spriteSourceSize": { "x": 0, "y": 0, "w": 24, "h": 41 }, 127 "frame": { "x": 310, "y": 1145, "w": 24, "h": 41 } 128 }, 129 "pao": { 130 "trimmed": false, 131 "sourceSize": { "w": 38, "h": 40 }, 132 "spriteSourceSize": { "x": 0, "y": 0, "w": 38, "h": 40 }, 133 "frame": { "x": 335, "y": 1145, "w": 38, "h": 40 } 134 } 135 } 136}
1$ spritepacker -f "./.test/image/**/*.png" -n icons -o ./.test --format css --frameName [dir][name] -s __
will replace "/" with "__"
1.icons { 2 background-image: url(icons.png); 3 background-repeat: no-repeat; 4 display: block; 5} 6.ground { 7 width: 720px; 8 height: 127px; 9 background-position: -1px -1px; 10} 11.endLine { 12 width: 711px; 13 height: 8px; 14 background-position: -1px -129px; 15} 16.tryagain { 17 width: 533px; 18 height: 90px; 19 background-position: -1px -138px; 20} 21.fruits__11 { 22 width: 408px; 23 height: 408px; 24 background-position: -1px -229px; 25} 26.gameover { 27 width: 358px; 28 height: 247px; 29 background-position: -1px -638px; 30} 31.p1 { 32 width: 319px; 33 height: 292px; 34 background-position: -722px -1px; 35} 36.p5 { 37 width: 319px; 38 height: 292px; 39 background-position: -410px -294px; 40} 41.fruits__10 { 42 width: 308px; 43 height: 309px; 44 background-position: -730px -294px; 45} 46.fruits__9 { 47 width: 308px; 48 height: 308px; 49 background-position: -1px -886px; 50} 51.fruits__8 { 52 width: 258px; 53 height: 258px; 54 background-position: -310px -886px; 55} 56.light { 57 width: 256px; 58 height: 256px; 59 background-position: -410px -604px; 60} 61.fruits__7 { 62 width: 193px; 63 height: 193px; 64 background-position: -569px -861px; 65} 66.fruits__6 { 67 width: 183px; 68 height: 183px; 69 background-position: -667px -604px; 70} 71.yes { 72 width: 182px; 73 height: 89px; 74 background-position: -535px -138px; 75} 76.fruits__5 { 77 width: 153px; 78 height: 152px; 79 background-position: -851px -604px; 80} 81.no { 82 width: 127px; 83 height: 89px; 84 background-position: -569px -1055px; 85} 86.fruits__4 { 87 width: 119px; 88 height: 119px; 89 background-position: -697px -1055px; 90} 91.fruits__3 { 92 width: 108px; 93 height: 108px; 94 background-position: -851px -757px; 95} 96.fruits__2 { 97 width: 80px; 98 height: 80px; 99 background-position: -960px -757px; 100} 101.fruits__1 { 102 width: 52px; 103 height: 52px; 104 background-position: -410px -229px; 105} 106.ban { 107 width: 24px; 108 height: 41px; 109 background-position: -310px -1145px; 110} 111.pao { 112 width: 38px; 113 height: 40px; 114 background-position: -335px -1145px; 115}
Support cocos creator
1$ spritepacker -f "./.test/image/**/*.png"-n icons -o ./.test --format plist --trim
1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3<plist version="1.0"> 4 <dict> 5 <key>frames</key> 6 <dict> 7 <key>ground.png</key> 8 <dict> 9 <key>spriteOffset</key> 10 <string>{0,0}</string> 11 <key>spriteSize</key> 12 <string>{720,127}</string> 13 <key>spriteSourceSize</key> 14 <string>{720,127}</string> 15 <key>textureRect</key> 16 <string>{{1,1},{720,127}}</string> 17 </dict> 18 <key>endLine.png</key> 19 <dict> 20 <key>spriteOffset</key> 21 <string>{0,0}</string> 22 <key>spriteSize</key> 23 <string>{711,8}</string> 24 <key>spriteSourceSize</key> 25 <string>{711,8}</string> 26 <key>textureRect</key> 27 <string>{{1,129},{711,8}}</string> 28 </dict> 29 <key>tryagain.png</key> 30 <dict> 31 <key>spriteOffset</key> 32 <string>{0,0}</string> 33 <key>spriteSize</key> 34 <string>{533,90}</string> 35 <key>spriteSourceSize</key> 36 <string>{533,90}</string> 37 <key>textureRect</key> 38 <string>{{1,138},{533,90}}</string> 39 </dict> 40 <key>fruits/11.png</key> 41 <dict> 42 <key>spriteOffset</key> 43 <string>{0,0}</string> 44 <key>spriteSize</key> 45 <string>{404,404}</string> 46 <key>spriteSourceSize</key> 47 <string>{408,408}</string> 48 <key>textureRect</key> 49 <string>{{1,229},{404,404}}</string> 50 </dict> 51 <key>gameover.png</key> 52 <dict> 53 <key>spriteOffset</key> 54 <string>{0,0}</string> 55 <key>spriteSize</key> 56 <string>{358,247}</string> 57 <key>spriteSourceSize</key> 58 <string>{358,247}</string> 59 <key>textureRect</key> 60 <string>{{1,634},{358,247}}</string> 61 </dict> 62 <key>p1.png</key> 63 <dict> 64 <key>spriteOffset</key> 65 <string>{0,0}</string> 66 <key>spriteSize</key> 67 <string>{319,292}</string> 68 <key>spriteSourceSize</key> 69 <string>{319,292}</string> 70 <key>textureRect</key> 71 <string>{{722,1},{319,292}}</string> 72 </dict> 73 <key>p5.png</key> 74 <dict> 75 <key>spriteOffset</key> 76 <string>{0,0}</string> 77 <key>spriteSize</key> 78 <string>{319,292}</string> 79 <key>spriteSourceSize</key> 80 <string>{319,292}</string> 81 <key>textureRect</key> 82 <string>{{406,294},{319,292}}</string> 83 </dict> 84 <key>fruits/9.png</key> 85 <dict> 86 <key>spriteOffset</key> 87 <string>{0,0}</string> 88 <key>spriteSize</key> 89 <string>{308,308}</string> 90 <key>spriteSourceSize</key> 91 <string>{308,308}</string> 92 <key>textureRect</key> 93 <string>{{726,294},{308,308}}</string> 94 </dict> 95 <key>fruits/10.png</key> 96 <dict> 97 <key>spriteOffset</key> 98 <string>{0,-1}</string> 99 <key>spriteSize</key> 100 <string>{304,303}</string> 101 <key>spriteSourceSize</key> 102 <string>{308,309}</string> 103 <key>textureRect</key> 104 <string>{{1,882},{304,303}}</string> 105 </dict> 106 <key>fruits/8.png</key> 107 <dict> 108 <key>spriteOffset</key> 109 <string>{0,0}</string> 110 <key>spriteSize</key> 111 <string>{258,258}</string> 112 <key>spriteSourceSize</key> 113 <string>{258,258}</string> 114 <key>textureRect</key> 115 <string>{{306,882},{258,258}}</string> 116 </dict> 117 <key>light.png</key> 118 <dict> 119 <key>spriteOffset</key> 120 <string>{-1,0}</string> 121 <key>spriteSize</key> 122 <string>{254,256}</string> 123 <key>spriteSourceSize</key> 124 <string>{256,256}</string> 125 <key>textureRect</key> 126 <string>{{406,603},{254,256}}</string> 127 </dict> 128 <key>fruits/7.png</key> 129 <dict> 130 <key>spriteOffset</key> 131 <string>{-1,1}</string> 132 <key>spriteSize</key> 133 <string>{187,187}</string> 134 <key>spriteSourceSize</key> 135 <string>{193,193}</string> 136 <key>textureRect</key> 137 <string>{{565,860},{187,187}}</string> 138 </dict> 139 <key>fruits/6.png</key> 140 <dict> 141 <key>spriteOffset</key> 142 <string>{0,0}</string> 143 <key>spriteSize</key> 144 <string>{183,183}</string> 145 <key>spriteSourceSize</key> 146 <string>{183,183}</string> 147 <key>textureRect</key> 148 <string>{{661,603},{183,183}}</string> 149 </dict> 150 <key>yes.png</key> 151 <dict> 152 <key>spriteOffset</key> 153 <string>{0,0}</string> 154 <key>spriteSize</key> 155 <string>{182,89}</string> 156 <key>spriteSourceSize</key> 157 <string>{182,89}</string> 158 <key>textureRect</key> 159 <string>{{535,138},{182,89}}</string> 160 </dict> 161 <key>fruits/5.png</key> 162 <dict> 163 <key>spriteOffset</key> 164 <string>{0,0}</string> 165 <key>spriteSize</key> 166 <string>{153,152}</string> 167 <key>spriteSourceSize</key> 168 <string>{153,152}</string> 169 <key>textureRect</key> 170 <string>{{845,603},{153,152}}</string> 171 </dict> 172 <key>no.png</key> 173 <dict> 174 <key>spriteOffset</key> 175 <string>{0,0}</string> 176 <key>spriteSize</key> 177 <string>{127,89}</string> 178 <key>spriteSourceSize</key> 179 <string>{127,89}</string> 180 <key>textureRect</key> 181 <string>{{565,1048},{127,89}}</string> 182 </dict> 183 <key>fruits/4.png</key> 184 <dict> 185 <key>spriteOffset</key> 186 <string>{0,0}</string> 187 <key>spriteSize</key> 188 <string>{119,119}</string> 189 <key>spriteSourceSize</key> 190 <string>{119,119}</string> 191 <key>textureRect</key> 192 <string>{{693,1048},{119,119}}</string> 193 </dict> 194 <key>fruits/3.png</key> 195 <dict> 196 <key>spriteOffset</key> 197 <string>{0,0}</string> 198 <key>spriteSize</key> 199 <string>{108,108}</string> 200 <key>spriteSourceSize</key> 201 <string>{108,108}</string> 202 <key>textureRect</key> 203 <string>{{845,756},{108,108}}</string> 204 </dict> 205 <key>fruits/2.png</key> 206 <dict> 207 <key>spriteOffset</key> 208 <string>{0,0}</string> 209 <key>spriteSize</key> 210 <string>{80,80}</string> 211 <key>spriteSourceSize</key> 212 <string>{80,80}</string> 213 <key>textureRect</key> 214 <string>{{954,756},{80,80}}</string> 215 </dict> 216 <key>fruits/1.png</key> 217 <dict> 218 <key>spriteOffset</key> 219 <string>{0,0}</string> 220 <key>spriteSize</key> 221 <string>{52,52}</string> 222 <key>spriteSourceSize</key> 223 <string>{52,52}</string> 224 <key>textureRect</key> 225 <string>{{406,229},{52,52}}</string> 226 </dict> 227 <key>ban.png</key> 228 <dict> 229 <key>spriteOffset</key> 230 <string>{0,0}</string> 231 <key>spriteSize</key> 232 <string>{24,41}</string> 233 <key>spriteSourceSize</key> 234 <string>{24,41}</string> 235 <key>textureRect</key> 236 <string>{{306,1141},{24,41}}</string> 237 </dict> 238 <key>pao.png</key> 239 <dict> 240 <key>spriteOffset</key> 241 <string>{0,0}</string> 242 <key>spriteSize</key> 243 <string>{38,40}</string> 244 <key>spriteSourceSize</key> 245 <string>{38,40}</string> 246 <key>textureRect</key> 247 <string>{{999,603},{38,40}}</string> 248 </dict> 249 </dict> 250 <key>metadata</key> 251 <dict> 252 <key>format</key> 253 <integer>3</integer> 254 <key>pixelFormat</key> 255 <string>RGBA8888</string> 256 <key>size</key> 257 <string>{1042,1186}</string> 258 <key>textureFileName</key> 259 <string>icons.png</string> 260 </dict> 261 </dict> 262</plist>
1import spritePacker from '@sjchang/sprite-packer'; 2 3const result = await spritePacker({ 4 file: './*.png', 5 maxWidth: 2048, 6 maxHeight: 2048, 7 format: 'JsonArray' 8}); 9 10// Image Buffer 11result.image; 12// JSON or CSS 13result.data; 14// coding
No vulnerabilities found.
No security vulnerabilities found.