Cirno Posted November 5, 2015 Share Posted November 5, 2015 Hello everyone. I'm newbie in phaser. I have a question about anchor and setsize.ex: I have a sprite 40x40 and anchor.x = 0,5 & anchor.y = 0.5. When i setSize(40,40) Sprite's body will look like origin sprite? #2 picture and if anchor.x = 0.5 & anchor.y = 1. What happend with body of sprite? #1pictute? Thank you Link to comment Share on other sites More sharing options...
ekeimaja Posted November 5, 2015 Share Posted November 5, 2015 It makes so, because anchor of Y-axis is 1 and X-axis is 0.5. You can define anchor easier like this: anchor.setTo(0.5, 0.5); Link to comment Share on other sites More sharing options...
Batzi Posted November 5, 2015 Share Posted November 5, 2015 Hello everyone. I'm newbie in phaser. I have a question about anchor and setsize.ex: I have a sprite 40x40 and anchor.x = 0,5 & anchor.y = 0.5. When i setSize(40,40) Sprite's body will look like origin sprite? #2 picture and if anchor.x = 0.5 & anchor.y = 1. What happend with body of sprite? #1pictute? Thank you when you say setSize(), are you doing this?sprite.body.setSize(x,y,width,height);If so, this will modify the position and width/height of the sprite's hitbox and not the actual sprite. Link to comment Share on other sites More sharing options...
Recommended Posts