From cc291ea65d2b0ffbda9ce6a9d9e946ff9bb98b7d Mon Sep 17 00:00:00 2001 From: Kaalleen Date: Sun, 11 Sep 2022 11:17:36 +0200 Subject: [PATCH] add create bingo area option --- .github/workflows/build.yml | 2 +- README.md | 19 +- bingo/bingo.inx => bingo.inx | 35 ++- bingo/bingo.py => bingo.py | 234 ++++++++++-------- preview/create_bingo_area.jpg | Bin 0 -> 41359 bytes preview/preview.jpg | Bin 0 -> 116974 bytes resources/preview.jpg | Bin 96616 -> 0 bytes .../template_grouped_clone.svg | 40 ++- .../template_simple.svg | 0 9 files changed, 184 insertions(+), 146 deletions(-) rename bingo/bingo.inx => bingo.inx (54%) rename bingo/bingo.py => bingo.py (56%) create mode 100644 preview/create_bingo_area.jpg create mode 100644 preview/preview.jpg delete mode 100644 resources/preview.jpg rename resources/grouped_clone_template.svg => samples/template_grouped_clone.svg (76%) rename resources/template_example.svg => samples/template_simple.svg (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f98140..2039acc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: - name: Make a file shell: bash run: | - 7z a bingo-${{ github.ref_name }}.zip bingo/ resources/ README.md LICENSE + 7z a bingo-${{ github.ref_name }}.zip bingo.py bingo.inx README.md LICENSE samples/ preview/ - name: Upload Bingo zip uses: actions/upload-artifact@v3 with: diff --git a/README.md b/README.md index 7ebf0f6..56b974b 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,24 @@ Works with Inkscape 1.2 * Open Extensions > Render > Bingo Card Creator * Set parameters as necessary and apply -![Bingo params preview](resources/preview.jpg) +![Bingo params preview](preview/preview.jpg) ## Bingo Templates -When a template has been opened in Inkscape before this extension is run, it will insert the bingo numbers into the predefined area(s). +When the extension is used on a document (template) with a bingo area, it will insert the bingo numbers into the predefined area(s) with predefined settings. -Create a bingo template by setting the id of a rectangle to `bingo-area`. For multiple areas append numbers to the id such as `bingo-area_1`. Clones of bingo-area-rectangles or clones of groups can also be used by setting their id accordingly. +### Create Bingo Areas + +* Open the Bingo Card Creator extension and set your content and layout settings. +* Switch to the template tab and enable `create bingo area` and apply. + +![Bingo template param](preview/create_bingo_area.jpg) + +This will include a bingo area into your document. You can now design your template. Group your design, select the group and clone the group. Label the clone to `Bingo Area` in the layer and objects dialog (Object > Layers and Objects). Create as many clones as you need. When finished run the Bingo Card Creator extension again. Disable create bingo area in the template tab and apply. All bingo areas will be filled with random numbers at once. + +### Manual setup of bingo areas + +Create a bingo template by setting the label of a rectangle to `Bingo Area`. Clones of bingo-area-rectangles or clones of groups can also be used by setting their label accordingly. Optionally append numbers to the label such as `Bingo Area #1` when multiple areas are in the document. Use Inkscapes XML-Editor to add following attributes to the bingo-area-rectangle (optional): @@ -51,4 +62,4 @@ Use Inkscapes XML-Editor to add following attributes to the bingo-area-rectangle If an attribute remains undefined, settings from user input will apply. Attributes will be carried over to subsequent areas - until overwritten. -For a better understanding have a look at the [template example file](resources/template_example.svg) in this repository. \ No newline at end of file +For a better understanding have a look at the samples in this repository. \ No newline at end of file diff --git a/bingo/bingo.inx b/bingo.inx similarity index 54% rename from bingo/bingo.inx rename to bingo.inx index 8628d3d..a23bd5b 100644 --- a/bingo/bingo.inx +++ b/bingo.inx @@ -9,29 +9,46 @@ - + BINGO 5 5 - 15 - 0 + 15 + 0 true - + - - 14 - 0x990000ff - 0x000000ff - 20 + + 14 + 0x990000ff + 0x000000ff + 20 true 1 + + + false + + + diff --git a/resources/template_example.svg b/samples/template_simple.svg similarity index 100% rename from resources/template_example.svg rename to samples/template_simple.svg