Take a look at <http://developer.android.com/reference/android/graphics/Canvas.html#drawBitmap(android.graphics.Bitmap, android.graphics.Rect, android.graphics.RectF, android.graphics.Paint)> http://developer.android.com/reference/android/graphics/Canvas.html
drawBitmap calls, (if your using the Android graphics and not the OpenGl graphics libs) You'll see this one in particular drawBitmap<http://developer.android.com/reference/android/graphics/Canvas.html#drawBitmap(android.graphics.Bitmap, android.graphics.Rect, android.graphics.RectF, android.graphics.Paint)>( Bitmap <http://developer.android.com/reference/android/graphics/Bitmap.html> bitmap, Rect<http://developer.android.com/reference/android/graphics/Rect.html> src, RectF<http://developer.android.com/reference/android/graphics/RectF.html> dst, Paint<http://developer.android.com/reference/android/graphics/Paint.html> paint)Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle. Where Bitmap is your Sprite sheet, src is a rectangle on your sprite sheet (just the section you want to draw) and dst is a destination rectangle on the canvas (where you want to draw it), and paint is your paint object. I'd give example code, but I've not actually written anything for android yet, so my example code would not be the best to learn from. Hopefully though, that function will show you the way. Nik 2009/5/17 G. Murat Taşbaşı <gmt...@gmail.com> > Hi guys, > > For a 2D game programming, I'm trying to learn about loading an > image file for all states of a game character (simply a walking soldier lets > say) and simply animate it. I think this classic method is called as sprite > imaging that you load whole image of all states of the character that you > want to animate. > > Is there anyone that can provide some sample code about this or at least > can you tell me which classes to use, how to refer some 'part of' whole > image file and animate it etc. > > Your help is much appreciated. > > Thanks a lot. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---