X-Git-Url: https://git.r.bdr.sh/rbdr/sumo/blobdiff_plain/f45bcde17fe0a8849e647ac843106fb51d2e8971..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; } };