geleto

Members
  • Content count

    3
  • Joined

  • Last visited

  1. How do I tween the rotation

    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: https://jsfiddle.net/o8dpLngw/1/ ...onUpdate( function(val){ console.log( logo.currentAngle, val*maxAngle, (1-val)*maxAngle) } )...
  2. How do I tween the rotation

    ... 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. How do I tween the rotation

    I could probably mess with currentTransform from update(), but is there a better way to tween a sprite rotation?