Support TexturePacker image atlases
This commit is contained in:
@@ -56,12 +56,16 @@ The shadow color alpha is multiplied by `RuntimeNode.alpha` and any runtime anim
|
||||
|
||||
### Image regions and nine-slice
|
||||
|
||||
Image-capable nodes (`image`, `sprite`, and image-backed `button`) may draw only part of an asset by setting source region fields in image pixels:
|
||||
Image-capable nodes (`image`, `sprite`, and image-backed `button`) may draw only part of an asset.
|
||||
|
||||
For manual atlas regions, set source fields in image pixels:
|
||||
|
||||
- `sourceX` / `sourceY`: top-left source position inside the loaded image.
|
||||
- `sourceWidth` / `sourceHeight`: source region size.
|
||||
|
||||
When source fields are omitted, the full image is used. This supports atlas-style usage where multiple sprites are packed into one image and nodes reference different source rectangles.
|
||||
For TexturePacker JSON atlases, declare `atlas` on an image resource and set `frame` on the node. Image-backed buttons may also use `pressedFrame` and `disabledFrame`. The runtime supports TexturePacker JSON Hash and JSON Array `frames` formats with non-rotated frames. `rotated: true` frames are rejected.
|
||||
|
||||
When frame/source fields are omitted, the full image is used.
|
||||
|
||||
Image-capable nodes may also use nine-slice scaling with source-pixel insets:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user