Reputation: 500
I want to show a sequence of animation(background Transparent) by using a spritesheet (generated by Texturepacker). is there any other engine(way) to show sprite sheet animation other than AndEngine?
Upvotes: 2
Views: 221
Reputation: 861
If you're drawing the bitmap using canvas you can call
public void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)
The bitmap is the spritesheet, the src Rect would be the individual sprite you would wish to show from the spritesheet. So if your spritesheet is a 100x100 bitmap of 16 25x25 px sprites you would use a rect of 0,0,25,25 to draw the first frame.
The dst Rect is the actual x/y coordinates and dimension of drawn sprite onto the canvas. Note you're able to change the original sprite dimensions and the canvas with automatically scale the sprite for you.
Now to animate the spritesheet all you need is some code to change the src Rect every time the frame index should increment.
Upvotes: 1