0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

changed Render.bodyIds to show all parts

This commit is contained in:
liabru 2015-03-09 22:35:59 +00:00
parent bf11ee5504
commit 3ed80343e1

View file

@ -758,17 +758,21 @@ var Render = {};
* @param {RenderingContext} context
*/
Render.bodyIds = function(engine, bodies, context) {
var c = context;
var c = context,
i,
j;
for (var i = 0; i < bodies.length; i++) {
var body = bodies[i];
if (!body.render.visible)
for (i = 0; i < bodies.length; i++) {
if (!bodies[i].render.visible)
continue;
c.font = "12px Arial";
c.fillStyle = 'rgba(255,255,255,0.5)';
c.fillText(body.id, body.position.x + 10, body.position.y - 10);
var parts = bodies[i].parts;
for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) {
var part = parts[j];
c.font = "12px Arial";
c.fillStyle = 'rgba(255,255,255,0.5)';
c.fillText(part.id, part.position.x + 10, part.position.y - 10);
}
}
};