Border around physics body

Hello everyone,

I am trying to create a colored border (stroke) around a physics body. I tried using strokeWidth and setStrokeColor to accomplish this, but it didn’t work as I intended. The physics body I am trying add a border to has a custom shape and when I try to add a stroke to it using the methods above, the object just has a rectangular border around it. Does anyone have any ideas or know if this is even possible? Any help is appreciated.

Thank you [import]uid: 47722 topic_id: 30353 reply_id: 330353[/import]

You’d likely draw a line and use same points from custom body for this, I don’t *believe* one can stroke the outline of a physics body. [import]uid: 52491 topic_id: 30353 reply_id: 121612[/import]

Peach is right, you can’t stroke a custom shape physics body with one line of code. That will just trace the outer dimensional bounds of the graphic or vector shape. You’ll need to draw a multi line, appending points to match those of your physics body.

Brent [import]uid: 9747 topic_id: 30353 reply_id: 121626[/import]

Thanks for confirmation Brent, great seeing all your posts lately! (Hoping to email you back in next day or so, been a bit mad lately; I know you know how that is ;-)) [import]uid: 52491 topic_id: 30353 reply_id: 121765[/import]

You’d likely draw a line and use same points from custom body for this, I don’t *believe* one can stroke the outline of a physics body. [import]uid: 52491 topic_id: 30353 reply_id: 121612[/import]

Peach is right, you can’t stroke a custom shape physics body with one line of code. That will just trace the outer dimensional bounds of the graphic or vector shape. You’ll need to draw a multi line, appending points to match those of your physics body.

Brent [import]uid: 9747 topic_id: 30353 reply_id: 121626[/import]

Thanks for confirmation Brent, great seeing all your posts lately! (Hoping to email you back in next day or so, been a bit mad lately; I know you know how that is ;-)) [import]uid: 52491 topic_id: 30353 reply_id: 121765[/import]