jasonstockton Posted March 1, 2014 Share Posted March 1, 2014 I'm trying to set the collision bounds of a sprite and from what I can tell player.body.setSize(w,h,x,y) is the way I do it. When I apply it it's saying the function doesn't exist on the object. When I have a look at the object it's not there. I'm using version 1.1.5 Is there a new way to do this or is it not supported on 1.1.5? Link to comment Share on other sites More sharing options...
Magnifisite Posted March 1, 2014 Share Posted March 1, 2014 I think the function you are looking for is setRectangle.player.body.setRectangle(w, h, translateX, translateY);From the docs width number <optional> The width of the rectangle. If not specified it will default to the width of the parent Sprite. height number <optional> The height of the rectangle. If not specified it will default to the height of the parent Sprite. translateX number <optional> The x amount the rectangle will be translated from the Sprites center. translateY number <optional> The y amount the rectangle will be translated from the Sprites center. Link to comment Share on other sites More sharing options...
jasonstockton Posted March 1, 2014 Author Share Posted March 1, 2014 Perfect! Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts