This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Change drawing row in my sprite sheets  RSS feed

 
Greenhorn
Posts: 5
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to develop my first Android app with animation using sprite sheets. I've followed this tutorial (http://obviam.net/index.php/sprite-animation-with-android/). Instead of using Elain_walk, i'm using guybrush's actions (https://www.dropbox.com/s/923fkvinkqi64r7/guybrush3.png) but I'm not understanding how to use a multi-row sprite sheets.

Additionally I changed 'spriteWidth' in ElaineAnimated.java from:



to


in order to fix guybrush stable in the screen...but it's a really bad workaround.

With this code it shows all moving guybrush ( https://www.dropbox.com/s/1npuvbz3789r8bc/GuyMove.jpg ) I can reduce spriteHeight like this:



but it shows only first row.

So, How can I move DestRect in order to show other rows? Thank you

This is the code:

ElaineAnimated.java http://pastebin.com/58Cjpvm8

MainGamePanel.java http://pastebin.com/RbQ6umCh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!