Ninjadoodle Posted August 27, 2017 Share Posted August 27, 2017 Hi guys I'm trying to setup a tween inside a classes mousedown function, but for some reason it's not doing anything. Any ideas on what I'm doing wrong? Thank you in advance LetterTile = game.Class.extend({ init: function(x, y, frame) { this.sprite = new game.Animation([ 'letterTile0001.png', 'letterTile0002.png', 'letterTile0003.png', 'letterTile0004.png', 'letterTile0005.png', 'letterTile0006.png', 'letterTile0007.png', 'letterTile0008.png', 'letterTile0009.png', 'letterTile0010.png', 'letterTile0011.png', 'letterTile0012.png', 'letterTile0013.png', 'letterTile0014.png', 'letterTile0015.png' ]); this.sprite.mousedown = function() { if (game.scene.started) { //this.scale.set(0.5); //this.alpha = (0.5); this.addTween(this.scale, { x: 0.5, y: 0.5 }, 1000, { easing: 'Quadratic.InOut', repeat: Infinity, yoyo: true }).start(); } } this.sprite.interactive = true; this.sprite.position.set(x, y); this.sprite.anchor.set(30, 30); this.sprite.stop(frame) this.sprite.addTo(game.scene.mg); } }); Quote Link to comment Share on other sites More sharing options...
enpu Posted August 27, 2017 Share Posted August 27, 2017 try game.scene.addTween Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted August 27, 2017 Author Share Posted August 27, 2017 Thanks heaps @enpu I always get confused on that one! It works perfectly Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.