If i use the DOM rendering engine, and add my elements manually, do they lose dragability? In this fiddle, http://jsfiddle.net/vauneen/ss5df/18/ , i just cant seem to make the elements drag-able. do i lose some functionality when rendering the DOM?
I just figured it out! edited the fiddle to render dom instead of canvas, like you said in the first place. thanks again Jasper, much appreciated.
Thanks you so much for your help. Please take a look at this fiddle (based on one of your basic examples:
http://jsfiddle.net/vauneen/ss5df/8/
i add an object to the world, and then i try assign my existing dom element to that object, unsuccessfully.
V
So in the first method you mentioned, are you saying that as long as i have 'rendered' the page with the dom rendering engine, i can call any existing elements using their id? eg:
<canvas id="viewport"> <div id="elasticdiv">123</div> </canvas> </code> </pre> And then: elasticdiv.view; </code> </pre> i dont think i've understood correctly, could you please explain? And in the second method, do you mean i could edit the 'createView' method in physicsjs to allow me to add a div? So that i could say: var el = document.createElement('div'); myEM.view = el ; </code> </pre> without getting a type error? V
fantastic! thanks so much for your help. and for PhysicsJS. V
thanks! that makes complete sense.
one thing i'm struggling with is how to refer to the dom element when its created using physicsjs.
for example, if i create a circle:
var myEM = Physics.body('circle', {....
and then i want to refer to that object as a dom element, how would i do that?
i've tried document.getElementById('myEM') and document.getElementByName('myEM')
could you help please?
V
Loving this!
is there any way to tween an object using physicsjs? i want and object to move one one corner to the center. would i need to make a constraint? cant i just tween?
Thanks again for the help and the product :)