Android Game Programming by Example by Horton John

Android Game Programming by Example by Horton John

Author:Horton, John [Horton, John]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2015-06-30T04:00:00+00:00


Next, we have the constructor that prepares our animation object for use. We will see exactly how we prepare for the actual animation soon. Note that there are a fair few parameters in the signature indicating that the animation is quite configurable. Just note that FPS in this context is not referring to the frame rate of the game but the frame rate of the animation.

Animation(Context context, String bitmapName, float frameHeight, float frameWidth, int animFps, int frameCount, int pixelsPerMetre){ this.currentFrame = 0; this.frameCount = frameCount; this.frameWidth = (int)frameWidth * pixelsPerMetre; this.frameHeight = (int)frameHeight * pixelsPerMetre; sourceRect = new Rect(0, 0, this.frameWidth, this.frameHeight); framePeriod = 1000 / animFps; frameTicker = 0l; this.bitmapName = "" + bitmapName; this.pixelsPerMetre = pixelsPerMetre; }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.