A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Software Craftsman
this week in the
Change drawing row in my sprite sheets
Joined: Aug 28, 2012
Feb 05, 2013 03:00:45
I'm trying to develop my first Android app with animation using sprite sheets. I've followed this tutorial (
). Instead of using Elain_walk, i'm using guybrush's actions (
) but I'm not understanding how to use a multi-row sprite sheets.
Additionally I changed 'spriteWidth' in ElaineAnimated.java from:
spriteWidth = bitmap.getWidth() / frameCount
spriteWidth = bitmap.getWidth() / frameCount - 21;
in order to fix guybrush stable in the screen...but it's a really bad workaround.
With this code it shows all moving guybrush (
) I can reduce spriteHeight like this:
spriteHeight = bitmap.getHeight() / 11;
but it shows only first row.
So, How can I move DestRect in order to show other rows? Thank you
This is the code:
Have you tried LearnNowOnline?
subject: Change drawing row in my sprite sheets
Java and Flickr - Help with Inheritance between Main Class and sub-class
Need help- 2 issues- searching for text in a list and applet not working
lost focus in JTable
Using a spritesheet
Upload css file
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015