add doc for texture packer
This commit is contained in:
parent
99dcb7e447
commit
1085057b0d
@ -4,4 +4,84 @@ sidebar_position: 2
|
||||
|
||||
# Texture Packer
|
||||
|
||||
> To be added
|
||||
## Overview
|
||||
|
||||
This guide explains how to use a **Texture Packer** workflow to bundle multiple image assets into a single atlas texture file. This enhances performance by reducing draw calls and improving load times.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Configuration
|
||||
|
||||
### Prepare Assets
|
||||
|
||||
Place finalized image assets into the `Raw-Assets` folder. These assets will be included in the texture atlas.
|
||||
|
||||
---
|
||||
|
||||
### Create a New Sprite Sheet
|
||||
|
||||
1. Launch **TexturePacker**
|
||||
2. Drag and drop your image assets
|
||||
3. Set **Data Format** to:
|
||||
- `Cocos2d-x` or
|
||||
- `Cocos Creator`
|
||||
4. Configure atlas settings such as:
|
||||
- Max size
|
||||
- Padding
|
||||
- Trimming options
|
||||
5. Set output location
|
||||
6. Configure scaling variants (explained below)
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
#### Recommended Settings
|
||||
|
||||
| Option | Value |
|
||||
|---------------------|------------------|
|
||||
| Trim Mode | Trim |
|
||||
| Texture Format | **PNG-32** |
|
||||
| Max Size | **2048x2048** |
|
||||
| Force Squared | Enabled |
|
||||
| Export Multipack | Manual |
|
||||
| Allow Rotation | Enabled |
|
||||
|
||||
---
|
||||
|
||||
#### Scaling Variants Settings
|
||||
|
||||
**Scaling Variants** allow you to export multiple resolution versions of the same atlas (e.g., desktop vs. mobile).
|
||||
|
||||
##### Setup Steps
|
||||
|
||||
1. Open the **Scaling Variants** panel
|
||||
2. Set **Preset** to `Custom`
|
||||
3. Click **Add** to create new variants
|
||||
|
||||
| Variant Name | Scale | Suffix |
|
||||
|--------------|--------|---------|
|
||||
| desktop | 1.0 | *(none)* |
|
||||
| mobile | 0.7 | `@0.7x` |
|
||||
|
||||
##### Example Scaling Variants
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Export Output
|
||||
|
||||
When exporting, TexturePacker generates:
|
||||
|
||||
- `.png` — Sprite atlas image
|
||||
- `.plist` / `.json` — Metadata with frame coordinates and dimensions
|
||||
|
||||
Example:
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
BIN
docs/04-game-asset-structure/img/scaling-variants.png
Normal file
BIN
docs/04-game-asset-structure/img/scaling-variants.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
docs/04-game-asset-structure/img/setting-texture-packer.png
Normal file
BIN
docs/04-game-asset-structure/img/setting-texture-packer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
BIN
docs/04-game-asset-structure/img/texture-files.png
Normal file
BIN
docs/04-game-asset-structure/img/texture-files.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
docs/04-game-asset-structure/img/texture-folder.png
Normal file
BIN
docs/04-game-asset-structure/img/texture-folder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
docs/04-game-asset-structure/img/texture-overview.png
Normal file
BIN
docs/04-game-asset-structure/img/texture-overview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
Loading…
x
Reference in New Issue
Block a user