spright
spright copied to clipboard
Sprite with same key prefix with same size
Hi,
There is any option that make all images with same prefix have the same size?
Example:
<key>explosion_1_2</key>
<dict>
<key>spriteOffset</key>
<string>{ 0, 0 }</string>
<key>spriteSize</key>
<string>{ 57, 56 }</string>
<key>spriteSourceSize</key>
<string>{ 57, 56 }</string>
<key>textureRect</key>
<string>{ { 964, 2 }, { 57, 56 } }</string>
<key>textureRotated</key>
<true />
<key>aliases</key>
<array />
</dict>
<key>explosion_1_3</key>
<dict>
<key>spriteOffset</key>
<string>{ 0, 0 }</string>
<key>spriteSize</key>
<string>{ 64, 63 }</string>
<key>spriteSourceSize</key>
<string>{ 64, 63 }</string>
<key>textureRect</key>
<string>{ { 449, 449 }, { 64, 63 } }</string>
<key>textureRotated</key>
<false />
<key>aliases</key>
<array />
</dict>
<key>explosion_1_4</key>
<dict>
<key>spriteOffset</key>
<string>{ 0, 0 }</string>
<key>spriteSize</key>
<string>{ 46, 45 }</string>
<key>spriteSourceSize</key>
<string>{ 46, 45 }</string>
<key>textureRect</key>
<string>{ { 964, 281 }, { 46, 45 } }</string>
<key>textureRotated</key>
<true />
<key>aliases</key>
<array />
</dict>
<key>explosion_1_5</key>
<dict>
<key>spriteOffset</key>
<string>{ 0, 0 }</string>
<key>spriteSize</key>
<string>{ 53, 52 }</string>
<key>spriteSourceSize</key>
<string>{ 53, 52 }</string>
<key>textureRect</key>
<string>{ { 964, 120 }, { 53, 52 } }</string>
<key>textureRotated</key>
<true />
<key>aliases</key>
<array />
</dict>
How to make all images that start with "explosion_1_" have the same size?
Thanks.
Hi,
the option trim none is the correct option?
Thanks.
Yes, you could either disable the trimming for these sprites or interpret the pivot point (aka anchor) which allows you to place differently trimmed sprites at the correct position. I just added the anchor to the cocos2x template.
With the latest version 3.5.2 glob only adds not yet encountered inputs.
So you could disable the trimming only for the explosion and keep it for the rest like this:
glob "images/explosion/*.png"
trim none
glob "images/**/*.png"
perfect, thanks