Jump to content

A question about setSize


Cirno
 Share

Recommended Posts

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

 

 

FpL9MiZ.jpg

Link to comment
Share on other sites

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

 

 

FpL9MiZ.jpg

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

 Share

  • Recently Browsing   0 members

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