ottohak Posted July 22, 2015 Share Posted July 22, 2015 Hi guys, Currently I draw a Circle(Graptics) on the Screen with Graphics.DrawCircle. And I would love to scale the circle with a tween Effect. Because the third parameter of drawCircle is asking for a radius I would love to change the value of the radius with a tween. Thats what I tried:var outerCircleRadius = 50.0;in create:outerCircleTween = game.add.tween(outerCircleRadius);outerCircleTween.to(50, 100, Phaser.Easing.Linear.None);outerCircleTween.start();in update:outerCircleGraphics.clear();outerCircleGraphics.drawCircle(400, 450, outerCircleRadius);outerCircleGraphics.endFill();But outerCircleRadius stays at 50. Thanks Link to comment Share on other sites More sharing options...
rich Posted July 22, 2015 Share Posted July 22, 2015 You can only tween object properties, so if you just do this it'll work:var circle = { radius: 0 };add.tween(circle).to({radius: 300} ...) Link to comment Share on other sites More sharing options...
jouniii Posted July 27, 2015 Share Posted July 27, 2015 Personally I recommend using properties for this, so you can do more than just change value of variable. My personal approach is "timeline" tween from 0 to 1 and then using it as reference how to modify composition of values. You get away with one tween and can do work of many tweens in properly synced style. Link to comment Share on other sites More sharing options...
Recommended Posts