Some resources that help with this will be libgdx (open source graphics engine for Android) created by the author of Beginning Android Games, a book which was very helpful in explaining these things to me when I wanted to do something similar.
On Friday, April 6, 2012 9:07:53 PM UTC-4, elix wrote:
HiI was trying to find an appropriate way to draw a portion of a bitmap rotated onto the canvas.Rotating canvas does not seem appropriate for my situation; I am working on a game, there will be up to 30 soldiers on the screen. Rotating the whole canvas seperately for each of them does not seem nice.I can't apply rotation to a matrix and use it in canvas.drawBitmap(source, matrix, paint) method. It works for the whole bitmap. I need to draw only a portion of bitmap at each frame. I am using sprite animation.Somethings could be done using Bitmap.createBitmap(...) method but making bitmap creations continuously at each frame isn't nice. While writing these something came to my mind :), may be I could divide the frames into different bitmap objects at initialization phase using this createBitmap method, then apply rotation to these bitmaps using matrix.Anyway, I will try this but I would be glad to hear better approaches.--
Emre
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment