Jump to content

Phaser - Rotate one sprite around another sprite


Recommended Posts

Hello developers,

I want to ask you a question ( it could be silly but I can't find anything that works in the forum or other articles ). I want to rotate one line around a circle and I will attach an image to understand me perfectly what i mean. So i searched a lot about rotation of sprites with Phaser but I can't find a working example or a working function that will do what I want. I'm pretty sure my thing is not a big deal so it should be available to be done.


I hope you can help me,




Link to comment
Share on other sites



I think you should change the pivot position of your rotating object so that the pivot and the center of your circle will be the same point and then, rotate this object (the line on your picture).


You can use :

yourDisplayObject.pivot.set(yourX, yourY);

(Doc : http://www.goodboydigital.com/pixijs/docs/classes/DisplayObject.html#property_pivot )


to set the pivot coordinates.



Link to comment
Share on other sites


  • Recently Browsing   0 members

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