Sign in to follow this  
Ninjadoodle

Drawing circle / tweening and anchor issue

Recommended Posts

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();

 

Share this post


Link to post
Share on other sites

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);

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.