How to scale an image to exactly fit a body?
Posted: Wed Oct 07, 2015 4:28 pm
I apologize if this has already been answered, but the forum keeps telling me "The following words in your search query were ignored because they are too common words" no matter what I put!
Suppose I have a scene that contains a bunch of circular bodies at different sizes and I'd like to use one image of a beach ball for every body. I duplicate and attach this image to each body and need to size it to match the body's size. Is there an easy way to do this? I'd also like to do this for square bodies.
I'm also curious whether this could be done from within Phaser after loading in my R.U.B.E. world. I would need to be able to detect the width of a body which has now been translated to pixels on the screen, size the sprite image accordingly and then attach it to the body. I looked into this but didn't have any luck.
Suppose I have a scene that contains a bunch of circular bodies at different sizes and I'd like to use one image of a beach ball for every body. I duplicate and attach this image to each body and need to size it to match the body's size. Is there an easy way to do this? I'd also like to do this for square bodies.
I'm also curious whether this could be done from within Phaser after loading in my R.U.B.E. world. I would need to be able to detect the width of a body which has now been translated to pixels on the screen, size the sprite image accordingly and then attach it to the body. I looked into this but didn't have any luck.