开发者

How to pull out individual sprites from grid of sprites?

开发者 https://www.devze.com 2023-01-20 02:51 出处:网络
I have sprites image, which contain set of sprites. i want to pull out each sprite from grid. I know that we 开发者_C百科have to split them through their pixels positions. But i think its not an eas

I have sprites image, which contain set of sprites. i want to pull out each sprite from grid.

How to pull out individual sprites from grid of sprites?

I know that we 开发者_C百科have to split them through their pixels positions. But i think its not an easy task and time consuming. so is there other way or tool to get thier pixel position to retrieve images ?

Thank you ,

Srinivas


I would suggest ImageMagick put I'm not sure it has an implementation that runs on Android.

http://www.imagemagick.org/Usage/crop/#crop

e.g.

convert spriteset.png -crop 20x20+10+10 cropped.png


Tell your artist to mono-space the sprites. And having flipped assets is useless since you can flip the texture yourself during load time (or at runtime).

With your current setup, you'll will need the pixel coordinate of the center of the sprite sheet, the height of each row of sprites, and the width of the sprites in each row (since your sprites appear to have varying widths).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号