diff --git a/demo/js/Demo.js b/demo/js/Demo.js index 35c2139..43290a9 100644 --- a/demo/js/Demo.js +++ b/demo/js/Demo.js @@ -627,9 +627,7 @@ render: { strokeStyle: '#ffffff', sprite: { - texture: './img/box.png', - xScale: 1, - yScale: 1 + texture: './img/box.png' } } }); @@ -641,9 +639,7 @@ friction: 0.01, render: { sprite: { - texture: './img/ball.png', - xScale: 1, - yScale: 1 + texture: './img/ball.png' } } }); diff --git a/src/body/Body.js b/src/body/Body.js index 47b8c24..9e5d962 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -43,7 +43,10 @@ var Body = {}; slop: 0.05, render: { visible: true, - sprite: null, + sprite: { + xScale: 1, + yScale: 1 + }, path: 'L 0 0 L 40 0 L 40 40 L 0 40', lineWidth: 1.5 } diff --git a/src/render/Render.js b/src/render/Render.js index ef10c4e..ed6ec27 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -317,7 +317,7 @@ var Render = {}; if (!body.render.visible) continue; - if (body.render.sprite && !options.wireframes) { + if (body.render.sprite && body.render.sprite.texture && !options.wireframes) { // body sprite var sprite = body.render.sprite, texture = _getTexture(render, sprite.texture); diff --git a/src/render/RenderPixi.js b/src/render/RenderPixi.js index d09a4a4..1ba2f65 100644 --- a/src/render/RenderPixi.js +++ b/src/render/RenderPixi.js @@ -239,7 +239,7 @@ var RenderPixi = {}; if (!bodyRender.visible) return; - if (bodyRender.sprite) { + if (bodyRender.sprite && bodyRender.sprite.texture) { var spriteId = 'b-' + body.id, sprite = render.sprites[spriteId], spriteBatch = render.spriteBatch;