Closed 942Avril closed 5 years ago
Fixed. Please, check here: http://free-tex-packer.com/test/
Can be used, but the result has a floating point value
The calculated offset value is incorrect
Do you have an examples for me? With correct values.
example.zip The texturePacker folder is the result of exporting with texturepacker. The freeTexPacker folder is the result of exporting with the link you sent. The sourceImg folder is the source file.
Ok, fixed. Please, try again: http://free-tex-packer.com/test/ Floating point offset values are valid: https://www.codeandweb.com/blog/2016/01/29/cocos2d-plist-format-explained
Calculation offset formula:
spriteSourceSize.x + spriteSourceSize.width/2 - sourceSize.width/2
(the offset of the sprite's untrimmed center to the sprite's trimmed center)
For example:
spriteSourceSize: x=320, y=55, width=193, height=399 sourceSize: width=800, height=800 offset.x = 320 + 193/2 - 800/2 = 16.5
FTP pack results: pack-result.zip
Image coordinate offset value is missing
Export the cocos2d project and find that spriteOffset is always {0,0}