0

I have another question related to this disk: http://dl.dropbox.com/u/8051037/disk_ab1.png

I have created a custom view, and set everything up to rotate it, but I don't know how to set the rotation of the view when the disk is spinning. I think I could've done this with an Animation object and a TimeInterpolater, but I couldn't figure out how to use either of those, so I created my own little algorithm for doing it. The code I have can be found at:https://github.com/c0dege3k/StarkOMFGB/blob/master/Mods/LauncherDisk.java.

Thanks for ANY help, this and my other question for this disk have been giving me serious problems.

c0dege3k
  • 67
  • 1
  • 10

1 Answers1

0

The easiest way will be to rotate the canvas than to draw the image and restore the canvas. For more info take a look here Rotating a view in Android

Community
  • 1
  • 1
Mojo Risin
  • 8,136
  • 5
  • 45
  • 58
  • ok. but if i wanted to increase/decrease from the current rotation, I still need a way to access the current rotation, right? – c0dege3k Mar 24 '11 at 17:02
  • add field mAngle which you'll increase/decrease and than just call invalidate and your view will be re-drawed. In onDraw rotate the canvas using mAngle. – Mojo Risin Mar 25 '11 at 00:30