Skip to content
Browse files

Add forceFinish to the sprite class.

  • Loading branch information...
1 parent 3de7d6e commit e46a02bc83ae6a66490635c1303693d903c8805a @jverkoey committed Mar 1, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 dev/engine/class.sprite.js
View
10 dev/engine/class.sprite.js
@@ -159,3 +159,13 @@ Breeze.Engine.Sprite.prototype.setAnimation = function(animation) {
this.textureFrame_ = this.animations_[this.currentAnimation_].frames[this.animationFrameIndex_];
this.frameAccum_ = 0;
};
+
+Breeze.Engine.Sprite.prototype.forceFinish = function() {
+ if (null != this.currentAnimation_) {
+ var animation = this.animations_[this.currentAnimation_];
+ this.animationFrameIndex_ = animation.frames.length - 1;
+ var animationFrame = animation.frames[this.animationFrameIndex_];
+ this.textureFrame_ = animationFrame;
+ this.currentAnimation_ = null;
+ }
+};

0 comments on commit e46a02b

Please sign in to comment.
Something went wrong with that request. Please try again.