Joined November 2012
·

Jasper Palfree

Toronto
·
·
·

Thanks. This helped me.
Also, if you use SCSS you can use the mixin to help with this:

@include font-face('PTSans', font-files('ptsans/pts55fwebfont.svg#PTSansRegular') 'ptsans/pts55fwebfont.eot', normal, normal);
@include font-face('PTSans', inline-font-files('ptsans/pts55fwebfont.woff', woff, 'ptsans/pts55fwebfont.ttf', truetype), $weight: normal, $style: normal);

--source http://stackoverflow.com/questions/10617306/new-bulletproof-font-face-syntax-using-data-uris-in-compass

Yes unfortunately, I've not yet got a general solution for cursor interactions since it depends on the rendering engine. It should be a matter of attaching mouse events to dragging the element. For example, on mousedown set the body to .fixed = true, and on mousemove change the .state.pos.set(x,y) to the position dictated by the mouse.

No... that doesn't make sense.
You need to either let the DOM rendering engine create elements for you, and then reference the myEM.view to access the htmlElement. Or you can create your own DOM element and assign it to myEM.view. Canvas won't work this way.

If you want to access them by their ids, you'll have to create your own elements and then manually assign them to the .view property in a PhysicsJS body (your myEM)

If you want to use canvas you'll have to use the canvas rendering engine, which stores Images inside the .view property.

If you create a jsFiddle of your work I could more easily see what you're trying to do.

You would have to use the "dom" rendering engine. and have it render at least once:
var renderer = Physics.renderer('dom", { ... });
world.add( renderer );
world.render();
myEM.view; // the dom element

otherwise you can create your own element and just place it in .view...
var el = document.createElement('div');
myEm.view = el;

Tweening might make sense to add in future, but the whole point of a physics engine is to simulate real physics. If you want a tween it might be best to use a combination of PhysicsJS and Greensock.

You could set body.fixed = true; while it's tweening and have the tweening engine modify the body.state.pos.set(x,y); so that the physics remains intact.

Air resistance can be set as a parameter to the world. The object tunneling is an outstanding issue, but one that many physics engines suffer due to the collision strategy. Hopefully one day that issue will be ironed out :)

@twolfson Totally correct. Thanks for the correction.

Achievements
224 Karma
8,443 Total ProTip Views