box2d-jquery icon indicating copy to clipboard operation
box2d-jquery copied to clipboard

remove box2d element

Open russellrain opened this issue 12 years ago • 8 comments

Hey, this is great, thanks for putting it together.

Is there an easy way to remove box2d from an element on the page after it has been added? I'm wanting to remove an image from the page at a certain point so the user can't interact with it anymore, but when i do $('#element').remove() it does remove the image, but I can still move the invisible placeholder that is there and it still collides with other elements on the page.

Thanks!

russellrain avatar Dec 13 '12 18:12 russellrain

or it would be nice to be able to just disable the ability to move the element, that would work too.

russellrain avatar Dec 13 '12 19:12 russellrain

currently there is no simple way to edit/remove a box2d body after was created

but there definitely should be, will add it soon

franzenzenhofer avatar Dec 13 '12 22:12 franzenzenhofer

Is there a way to just remove the effects?

heaversm avatar Jan 18 '13 15:01 heaversm

+1 for this feature

alchemyasia avatar Apr 26 '13 02:04 alchemyasia

+1.

liuyanghejerry avatar Jun 07 '13 13:06 liuyanghejerry

+1

oakbarrel avatar Sep 30 '13 21:09 oakbarrel

i'm currently in the phase of hiring somebody to revive this project again, we will see how it works out.

franzenzenhofer avatar Oct 01 '13 07:10 franzenzenhofer

Hey guys, the current develop branch contains functionality that lets you remove a body from box2d as you remove an element from the DOM. So now $('#element').remove() also removes from the box2d world, feel free to check out the example in examples/remove-elements.html

pa7 avatar Oct 29 '13 22:10 pa7