nak3ddogs Posted August 14, 2014 Share Posted August 14, 2014 hi. i would mask smthing and move the mask. i have a solution, but do u know any better solution then it.var numberTween = {step: 0};var shape = game.add.graphics();player.mask = shape;game.add.tween(numberTween).to({step:500}, 5000, Phaser.Easing.in, true, 0, 0, false);function update() { game.shape.clear(); game.shape.beginFill(2, 0x0000f, 1); game.shape.drawRect(0 , 0 + numberTween.step, game.world.width,game.world.height);}thx for any advice Link to comment Share on other sites More sharing options...
nak3ddogs Posted August 14, 2014 Author Share Posted August 14, 2014 can i make this without using the update section? coz it will be a event for menu change Link to comment Share on other sites More sharing options...
lewster32 Posted August 14, 2014 Share Posted August 14, 2014 You can use the tween's onUpdateCallback to add stuff which should be done every frame that the tween runs. nak3ddogs 1 Link to comment Share on other sites More sharing options...
nak3ddogs Posted August 14, 2014 Author Share Posted August 14, 2014 ty Link to comment Share on other sites More sharing options...
nak3ddogs Posted August 14, 2014 Author Share Posted August 14, 2014 and the perfect solution for me heregame.add.tween(numberTween).to({step:500}, 1000, Phaser.Easing.Quadratic.In, true, 0, false).onUpdateCallback(function(){ game.shape.clear(); game.shape.beginFill(2, 0x0000f, 1); game.shape.drawRect(0 , 0 + numberTween.step, game.world.width,game.world.height); console.log(numberTween.step); }); yougotashovel and lewster32 2 Link to comment Share on other sites More sharing options...
Recommended Posts