Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nirokay/cardgenerator
A simple generator for cards.
https://github.com/nirokay/cardgenerator
automation creator-tools generator playing-cards
Last synced: 20 days ago
JSON representation
A simple generator for cards.
- Host: GitHub
- URL: https://github.com/nirokay/cardgenerator
- Owner: nirokay
- License: gpl-3.0
- Created: 2023-07-21T09:37:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-29T14:07:31.000Z (over 1 year ago)
- Last Synced: 2023-07-29T15:21:35.218Z (over 1 year ago)
- Topics: automation, creator-tools, generator, playing-cards
- Language: Nim
- Homepage:
- Size: 5.81 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CardGenerator
CardGenerator generates playing cards from a couple of resources (such as base background, colours, images).
## Usage
```txt
-h, --help Displays this help message and quits.
-v, --version Displays the program version and quits.
-d, --directory Sets the resource directory.
-o, --output Sets the output directory for final cards.
-f, --fontsize Sets the global font size for card images.
-z, --safezone Sets the pixels-indents from the corners.
-s, --shadow Toggles if the text should have shadows (slow).
-c, --shadowcolour Sets the shadow colour. Four values (rgba) seperated by commas (example: '255,255,255,255').
```## Resource directory structure
### Files
* `base_card.png`
* `font.ttf` / `font.otf`
You can override these on a by-colour basis. For example, you want to have one base card for red and another for all other colours:
Create these files:
* `base_card.png` for all colours
* `base_card.red.png` to override the base card for red
The same is true for font files!
### Directories
Each directory you create in the resource directory is a colour. You can name the directories anything you want - they do not have to be colours.
For example: `./69/`, `./purple/`, `./amongus` are all valid.
Inside these directories you can put your overlay images. Name them like you want the cards to appear as: `A.png -> "A"`, `9.png -> "9"`, `Ace.png -> "Ace"`
These overlay images will be centered and drawn directly onto the base card.
**Note:** Overlay images should always be smaller than the base card, as then the overlay would be bigger than the "background"!
### Example
```txt
root: ./
|
| > .some_file.txt # dot-files are ignored!
|
| > font.ttf # font used on all cards
| > font.red.ttf # OPTIONAL: overrides font used on red cards
|
| > base_card.png # image used for the background of all cards
| > base_card.red.png # OPTIONAL: overrides base card ONLY for red
|
| > red/ # contains card images for red cards
| | > 9.png # card image for card '9'; '9' will be printed onto the card
| | > Ace.png # 'Ace' will be printed onto the card
|
| > blue/ # same as red, but only for blue
| > 9.png
| > Ace.png
```## Examples
### Base cards
| Default | Red | Blue
|:------------------------------------------------------:|:------------------------------------------------------:|:--------------------------------------------------------:
| ![default base card](examples/resources/base_card.png) | ![red base card](examples/resources/base_card.red.png) | ![blue base card](examples/resources/base_card.blue.png)### Characters
| \# | Ace-Card | 9-Card |
|:----:|:-----------------------------------------------:|:------------------------------------------------------:|
| Blue | ![blue 9](./examples/resources/blue/Ace.png) | ![blue ace](./examples/resources/blue/9.png) |
| Red | ![red 9](./examples/resources/red/Ace.png) | ![red ace](./examples/resources/red/9.png) |### Final cards
| \# | Ace-Card | 9-Card |
|:----:|:-----------------------------------------------:|:------------------------------------------------------:|
| Blue | ![blue 9](./examples/output/blue/Ace.png) | ![blue ace](./examples/output/blue/9.png) |
| Red | ![red 9](./examples/output/red/Ace.png) | ![red ace](./examples/output/red/9.png) |Generated using `./cardgenerator -o:./examples/output -f:100 -d:./examples/resources -s -c:255,255,255,255 -z:50`!