Skip to content

Commit

Permalink
add texturepacker docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Feb 6, 2023
1 parent 3b064e6 commit 0c0274b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/texture-packer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,20 @@ raw-assets
- `tps`: The tag used to denote a folder that should be processed by Texture Packer.
- `fix`: The tag used to denote that the spritesheet should be fixed to a specific resolution.
- `jpg`: The tag used to denote the spritesheet should be saved as a jpg.

## Pixi Specific

If you are generating multiple resolutions of a spritesheet right now Pixi does not know how to handle this. To get around this you will need to add a `ResolveParser` like so:

```ts
import { settings, extensions, ResolveURLParser, ExtensionType } from 'pixi.js';

export const resolveJsonUrl = {
extension: ExtensionType.ResolveParser,
test: (value: string): boolean =>
settings.RETINA_PREFIX.test(value) && value.endsWith('.json'),
parse: resolveTextureUrl.parse,
} as ResolveURLParser;

extensions.add(resolveJsonUrl);
```

0 comments on commit 0c0274b

Please sign in to comment.