Jump to content

dynamically adding a tweendata to a tween object


Recommended Posts

I am trying to add a tweendata dynamically to an tween object, while the tween object property isRunning set to true. I figure a solution for my problem out. But I feel I should be able to get this to work too. Have a look and please get back to me on what is missing.

var child = new Phaser.TweenData(tween);
child.from({x: child.target.position.x, y:child.target.position.y}).to({x:-75,y:75}, 1000, Phaser.Easing.Circular.InOut,0,0,true);
child.parent.onComplete.addOnce(()=> (target, tween){
console.log('tween:',tween, 'target:',target);
//try calling child.start() to run it manually here, 
//...remove child from tween to stop repeat. if you know a better way via library 'Phaser' to do this, please share. 

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...