• Content Count

  • Joined

  • Last visited

About geleto

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I don't get the delta in the callback. It seems to pass the current tween value in the 0-1 range except that for InOut easing, when reaching 1, instead of tweening back to 0 - it starts incrementing from 0. Here's a fiddle: ...onUpdate( function(val){ console.log( logo.currentAngle, val*maxAngle, (1-val)*maxAngle) } )...
  2. ... I've found a solution: game.RotatableEntity = me.Entity.extend({ init: function(x, y, sprite) { this._super(me.Entity, "init", [x, y, { width: sprite.width, height: sprite.height }]); this.renderable = sprite; this.currentAngle = 0; this.prevAngle = 0; }, update: function() { this.renderable.currentTransform.rotate(this.currentAngle-this.prevAngle); this.prevAngle = this.currentAngle; return true; } });
  3. I could probably mess with currentTransform from update(), but is there a better way to tween a sprite rotation?