Jump to content

Sprite rotation relative to point of other sprite into the group


molo4nik111
 Share

Recommended Posts

I got 2 images created in extended group:

 

this.body = this.create(0, 0, 'character_body');
this.arm = this.create(x, y, 'character_arm');
 
i.e. x,y - shoulder character_body coords;
 
I rotate my character_body like metronome with :
 
this.body.anchor.setTo(0.5,1);
 
// but this attach rotation point of my sprite to the 0,0 coordinates of group, and i need to set coordinates of group in canvas according to my child sprites offset into group.
i.e. coordinates of group (0,0) , and sprite with anchor.setTo(0.5,1) is out of the canvas.
This is sub question - How to make the group rotate like the sprite with anchor? pivot just offset the rotate point in the canvas.
 
So. I want that character_arm got the point of rotation at the shoulder no matter which position got the character_body when rotating. And that's main question!
 
I used to use pivots on parts, on full group, anchors to sprites in group, but can't do this. 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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