X-Git-Url: https://git.r.bdr.sh/rbdr/sumo/blobdiff_plain/0616b3f00653c66b5e34814653e33413b9ec034e..7ade6f8d96825386bf2e89dea51f9297cbac8e9c:/lib/factories/pixi.js?ds=inline diff --git a/lib/factories/pixi.js b/lib/factories/pixi.js index e3c1b5a..839e593 100644 --- a/lib/factories/pixi.js +++ b/lib/factories/pixi.js @@ -16,9 +16,9 @@ export default { * @memberof PixiFactory * @return {external:CreateJs.Container} the created container */ - createSumo() { + createSumo(config) { - const radius = 25; + const radius = config.radius; // The body const body = new Graphics(); @@ -60,6 +60,46 @@ export default { body.addChild(leftPupil); body.addChild(rightPupil); + return body; + }, + + /** + * Creates an empty graphic + * + * @function createEmptyGraphic + * @memberof PixiFactory + * @return {external:CreateJs.Container} the created container + */ + createEmptyGraphic(config) { + + return new Graphics(); + }, + + /** + * Creates a harness graphic + * + * @function createHarness + * @memberof PixiFactory + * @return {external:CreateJs.Container} the created container + */ + createHarness(config) { + + const radius = config.radius; + + const lineThickness = 10; + + // The body + const body = new Graphics(); + body.lineStyle(lineThickness, 0xe1e1e1, 1) + .drawCircle(0, 0, radius); + + const center = new Graphics(); + center.beginFill(0xf1f1f1) + .drawCircle(0, 0, radius - lineThickness / 2) + .endFill(); + + body.addChild(center); + return body; } };