Jump to content

Rotate graphics individually/independently?


proyb2
 Share

Recommended Posts

Could I rotate only Ellipse without affected Line position and angle?

var graphics = game.add.graphics(100,200);graphics.lineStyle(2,0x33FF00,1);graphics.moveTo(0,0);graphics.lineTo(20,199);graphics.beginFill(0x000000);graphics.angle=-45;graphics.drawEllipse(0, 0, 100, 200);graphics.endFill();
 
If using sprite to rotate, the graphics edge and line appear to jerky, how to make it smooth?
sprite = game.add.sprite(30, 100, graphics.generateTexture());sprite.y=280sprite.x=178sprite.angle=-17

 

 

 

 

 

 

Link to comment
Share on other sites

You could use sprite1.addChild(sprite2), that way the second sprite's position would be slaved to the first one's. Careful though, the second sprite's position will now be relative to sprite1! :)

 

Ah, good idea. Sorry, the last question if the graphics could be convert to bitmapdata which can be further draw on anything and finally convert to sprite. I think there's a missing tutorials for this use case.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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