X-Git-Url: https://git.r.bdr.sh/rbdr/sumo/blobdiff_plain/493ec31cb19b4211c703762d14a4e6232c4c2143..7ade6f8d96825386bf2e89dea51f9297cbac8e9c:/lib/factories/pixi.js?ds=sidebyside diff --git a/lib/factories/pixi.js b/lib/factories/pixi.js index 851a074..839e593 100644 --- a/lib/factories/pixi.js +++ b/lib/factories/pixi.js @@ -73,6 +73,34 @@ export default { 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; } };