Jump to content

rotation and getbounds


Stephen Persson
 Share

Recommended Posts

I'm using Phaser 2.3.0 and I want to know the bounds of a rotated sprite.

But when I change sprite.rotation, the values of sprite.getBounds() don't change:

var sprite = game.add.sprite(0, 0, "sprite"); // game.load.spritesheet("sprite", "spritesheet.png", 32, 32);console.log(sprite.getBounds()); // Object { x: 0, y: 0, width: 32, height: 32, type: 22 }sprite.rotation = 0.52; // 30°console.log(sprite.getBounds()); // Object { x: 0, y: 0, width: 32, height: 32, type: 22 }
What's wrong?

How can I get the correct bounds?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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