Ninjadoodle Posted July 9, 2018 Share Posted July 9, 2018 Hi @enpu I'm trying to draw a circle and animate it. I can't seem to be able to set its anchor. By default, it seems like it's anchor is near it's middle, but I thin there might be a bug somewhere. var bgCircle = new game.Graphics(); bgCircle.drawCircle(640, 960, 720); //bgCircle.anchorCenter(); bgCircle.alpha = 0.25; bgCircle.addTo(game.scene.fg); game.Tween.add(bgCircle.scale, { x: 0.95, y: 0.95 }, 1000, { easing: 'Quadratic.InOut', repeat: Infinity, yoyo: true }).start(); Quote Link to comment Share on other sites More sharing options...
enpu Posted July 9, 2018 Share Posted July 9, 2018 If your Graphics object has only one shape, you should draw it at position 0,0 and then change the position of the Graphics object. var bgCircle = new game.Graphics(); bgCircle.drawCircle(0, 0, 720); bgCircle.position.set(640, 960); bgCircle.alpha = 0.25; bgCircle.addTo(game.scene.fg); Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted July 9, 2018 Author Share Posted July 9, 2018 @enpu Nice! That works perfectly - thank you for explaining this Quote Link to comment Share on other sites More sharing options...
pstrejczek Posted July 10, 2018 Share Posted July 10, 2018 Thanks, @enpu for this tip. It also helped me with one of the problems in the game I'm working on. 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.