[Phaser 3](https://github.com/photonstorm/phaser) Pack File Generator ------
npm install @paxperscientiam/generate-phaser3-filepackPhaser 3 Pack File Generator
------
json
{
"ignoredPaths"?: string|string[] // string ready to be converted to RegEx
"extensions"?: string // optional comma-separated list of allowed file extensions, default action is not to filter by extension
"options":? {
"keyFormat"?: "namespaced"|"filebasename" ,
"outputDuplicateKeyWarning"?: boolean
"applyProAssetKeyPrefix"?: boolean
"removeBaseDirFromURL"?: boolean
},
"targets": [
{
"key": string // unique key to describe set of targeted files
"basePath": string // which directory to search
"hint"?: ["audio"|"image"|"bitmapFont"] // optionally assert asset type
"extensions"?: string // comma separated list of allowed file extensions, takes precedence over higher-level definition
"ignoredPaths"?: string|string[] // string ready to be converted to RegEx
},
{
// additional targets
}
]
}
`This script processes targets sequentially. What this means is that files found in the first target folder will not be processed a second time, even if included in the second target. This prevents double-processing, which is useful if higher-ranked target is type-hinted.
For assets that are not automatically inferred, you'll probably want to take advantage of hint options.
$3
`shell
npx @paxperscientiam/generate-phaser3-filepack `
Example of invocation and saving (careful not overwrite unintentionally):
`shell
npx @paxperscientiam/generate-phaser3-filepack config.json > filepack.json`
Notes
This script does NOT write anything to file; it's up to you to do so.If you set a "hint", it's assumed accurate.
$3
- [ ] atlas
- [ ] atlasXML
- [ ] audioSprite
- [ ] htmlTexture
- [ ] multiatlas
- [ ] obj
- [ ] spritesheet
- [ ] tilemapCSV
- [ ] tilemapImpact
- [ ] tilemapTiledJSON
- [ ] unityAtlas
- [x] audio (:IPhaserFilePackGenericAsset)
- [x] binary (:IPhaserFilePackBinaryAsset)
- [x] css
- [x] glsl
- [x] html
- [x] image (:IPhaserFilePackGenericAsset)
- [x] json
- [x] svg
- [x] text
- [x] video
- [x] xml
$3
- [x] atlas
- [x] bitmapFont
$3
- [ ] allow set asBlob and noAudio` in post-processing.