Jump to content

Sprite child rotation limited?


Davaaron
 Share

Recommended Posts

Hi,

 

i'm sticking together multiple sprites and do some translation and rotation with the parent sprite. All children sprites behave like expected, rotating with the parent sprite around its center point. But one sprite doesn't do so. It came to my mind that I should try to let it rotate incrementally by setting sprite.children[0].rotation += 0.1 but that sprite never rotates completely. It onl wiggles a little to the left and then a little to the right. All other sprites are really rotating, except that one.

 

As I don't even have a clue what could cause this issue, I hope some can help me out. Unfortunately I could not reproduce that problem with the sandbox here.

        var parent = game.add.sprite(0, 0, 'parent');
        parent.anchor.set(0.5);
        var child1 = game.add.sprite(0, 0, 'child');
		child1.anchor.set(0.5);
        child1.scale.setTo(.5);
        setMinMaxScaleToOwnScale(child1);
        child1.x = newPosX;
        child1.y = newPosY;
		parent.addChild(child1);

This is the routine I use for all the sprites which are attached to the parent. As I said, every sprite behaves correctly except that one sprite.

Someone got any ideas on that issue? 

Appreciate your answers :)

 

Edit: It seems like the children are trying to scale when the parent or themselves are rotating. That's awkward.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...