Jump to content

Center shape after rotation


Wnitsch
 Share

Recommended Posts

I'm creating triangles using Phaser.Graphics.drawTriangle. Then I'm rotating the shape by the center point (width/2, height/2). After that I want to place triangles side by side, but, after the rotation the height and width may change, so I recalculate this and get a new center point. But the shapes are not very well placed.

How to place it right? There is another way to center the shapes?

In attchament I generated the same triangle side by side rotating then 45°. The red dot and the lines are only for reference where they would be.

Thanks in advance,

triangles.PNG

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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