franzenzenhofer / box2d-jquery

convert your DOM into physical objects using this awesome jQuery wrapper around box2d-web
456 stars 71 forks source link

remove box2d element #5

Open russellrain opened 11 years ago

russellrain commented 11 years ago

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 commented 11 years ago

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

franzenzenhofer commented 11 years ago

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

but there definitely should be, will add it soon

heaversm commented 11 years ago

Is there a way to just remove the effects?

alchemyasia commented 11 years ago

+1 for this feature

liuyanghejerry commented 11 years ago

+1.

oakbarrel commented 10 years ago

+1

franzenzenhofer commented 10 years ago

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

pa7 commented 10 years ago

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