Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
249 changes: 249 additions & 0 deletions src/sheets/dice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,144 @@ sheet.glyphs.set("d6-1", (canvas: SVGContainer) => {
return group;
});

sheet.glyphs.set("d6-10", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
.radius(10, 10)
.fill("none")
.stroke({width: 1, color: "#000"})
.attr("data-context-border", true)
.attr("data-playerfill", true)
.center(25, 25);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 40);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 40);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 20);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 30);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 20);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 30);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 40);
group.viewbox(0, 0, 50, 50);
return group;
});

sheet.glyphs.set("d6-11", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
.radius(10, 10)
.fill("none")
.stroke({width: 1, color: "#000"})
.attr("data-context-border", true)
.attr("data-playerfill", true)
.center(25, 25);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 40);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 40);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 20);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 30);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 20);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 30);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 25);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 40);
group.viewbox(0, 0, 50, 50);
return group;
});

sheet.glyphs.set("d6-12", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
.radius(10, 10)
.fill("none")
.stroke({width: 1, color: "#000"})
.attr("data-context-border", true)
.attr("data-playerfill", true)
.center(25, 25);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 40);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 40);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 20);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(10, 30);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 20);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(40, 30);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 10);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 20);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 30);
group.circle(8).fill("#000")
.attr("data-context-fill", true)
.center(25, 40);
group.viewbox(0, 0, 50, 50);
return group;
});

sheet.glyphs.set("d6-2", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
Expand Down Expand Up @@ -155,6 +293,117 @@ sheet.glyphs.set("d6-6", (canvas: SVGContainer) => {
return group;
});

sheet.glyphs.set("d6-7", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
.radius(10, 10)
.fill("none")
.stroke({width: 1, color: "#000"})
.attr("data-context-border", true)
.attr("data-playerfill", true)
.center(25, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 40);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 40);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(25, 25);
group.viewbox(0, 0, 50, 50);
return group;
});

sheet.glyphs.set("d6-8", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
.radius(10, 10)
.fill("none")
.stroke({width: 1, color: "#000"})
.attr("data-context-border", true)
.attr("data-playerfill", true)
.center(25, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 40);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 40);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(25, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(25, 40);
group.viewbox(0, 0, 50, 50);
return group;
});

sheet.glyphs.set("d6-9", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
.radius(10, 10)
.fill("none")
.stroke({width: 1, color: "#000"})
.attr("data-context-border", true)
.attr("data-playerfill", true)
.center(25, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 40);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 40);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(10, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(40, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(25, 10);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(25, 25);
group.circle(10).fill("#000")
.attr("data-context-fill", true)
.center(25, 40);
group.viewbox(0, 0, 50, 50);
return group;
});

sheet.glyphs.set("d6-empty", (canvas: SVGContainer) => {
const group = canvas.symbol();
group.rect(48, 48)
Expand Down
5 changes: 5 additions & 0 deletions test/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
"description": "An example of the `stacking-offset` renderer",
"render": "{\"renderer\":\"stacking-offset\",\"board\":{\"style\":\"vertex-cross\",\"width\":7,\"height\":7},\"legend\":{\"A\":{\"name\":\"piece\",\"colour\":1},\"B\":{\"name\":\"piece\",\"colour\":2}},\"pieces\":\"-,-,-,-,-,-,-\\n-,-,-,-,-,-,-\\n-,-,-,-,-,-,-\\n-,-,-,-,B,-,-\\n-,-,-,B,A,B,-\\n-,-,A,-,A,BA,B\\n-,-,-,-,-,ABA,-\"}"
},
"pieces-dice": {
"name": "Glyphs: Dice",
"description": "An example of dice.",
"render": "{\"board\":{\"style\":\"squares\",\"width\":5,\"height\":3,\"rowLabels\":[\"\",\"\",\"\"],\"columnLabels\":[\"\",\"\",\"\",\"\"],\"strokeColour\":{\"func\":\"flatten\",\"fg\":\"_context_strokes\",\"bg\":\"_context_background\",\"opacity\":0.15}},\"legend\":{\"A0\":{\"name\":\"d6-empty\",\"colour\":1,\"scale\":1.15},\"A1\":{\"name\":\"d6-1\",\"colour\":1,\"scale\":1.15},\"A2\":{\"name\":\"d6-2\",\"colour\":1,\"scale\":1.15},\"A3\":{\"name\":\"d6-3\",\"colour\":1,\"scale\":1.15},\"A4\":{\"name\":\"d6-4\",\"colour\":1,\"scale\":1.15},\"A5\":{\"name\":\"d6-5\",\"colour\":1,\"scale\":1.15},\"A6\":{\"name\":\"d6-6\",\"colour\":1,\"scale\":1.15},\"A7\":{\"name\":\"d6-7\",\"colour\":1,\"scale\":1.15},\"A8\":{\"name\":\"d6-8\",\"colour\":1,\"scale\":1.15},\"A9\":{\"name\":\"d6-9\",\"colour\":1,\"scale\":1.15},\"B0\":{\"name\":\"d6-empty\",\"colour\":2,\"scale\":1.15},\"B1\":{\"name\":\"d6-1\",\"colour\":2,\"scale\":1.15},\"B2\":{\"name\":\"d6-2\",\"colour\":2,\"scale\":1.15},\"B3\":{\"name\":\"d6-3\",\"colour\":2,\"scale\":1.15},\"B4\":{\"name\":\"d6-4\",\"colour\":2,\"scale\":1.15},\"B5\":{\"name\":\"d6-5\",\"colour\":2,\"scale\":1.15},\"B6\":{\"name\":\"d6-6\",\"colour\":2,\"scale\":1.15}},\"pieces\":\"A1,A2,-,A4,A7\\n-,A3,B1,-,A8,-\\n-,A5,A6,-,A9\"}"
},
"pieces-text": {
"name": "Glyphs: Text",
"description": "An example of glyphs created from arbitrary text. Note that in this case you set `orientation` to `vertical` so that, even if rotated, the text is still legible.",
Expand Down
Loading