Skip to content

andrewalbers/CardCreator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CardCreator

A Processing script to help automate Playing Card creation

Alt text

The Problem

Making changes to a lot of cards can be time-consuming if you are manually editing and saving each card separately. This program attempts to make this easier with a customizable template file, so you can regenerate all cards instantly whenever you change the layout, add/remove design elements, or edit your art files and game text.

Setup

To see an example:

  1. Download and install Processing
  2. Clone or download CardCreator to your local machine.
  • If downloaded, rename the enclosing folder to 'CardCreator'
  1. Open CardCreator.pde in the Processing IDE.
  2. Hit Play

Alt text 5. Four example card files should appear in your CardCreator directory

How it Works

CardCreator.pde builds each card file by layering text and image elements according to two files, a template and a content sheet.

Alt text

Template.csv lists all elements (images and text) to include in every card, including the x/y positions, width, and height of each element type in pixels.

Alt text

  • The first elements listed in template.csv are placed first, so they will be covered by any elements listed further down.

Content.csv represents each card as a separate row. These rows contain the card's unique text & images, which will be placed according to the rules given for their corresponding elements in template.csv.

Alt text

  • For image elements, content.csv stores the image filename. (This must be in the data folder)
  • For text elements, content.csv lists the actual game text to display.

How to Use It

Apart from changing all the art and editing the game text in contents.csv, you'll probably also want to modify the template itself. Here's an example:

Say I want to add a Pilot icon to certain cards to show that those characters can fly spaceships.

  1. First, I create the pilot icon and save this in the data folder. For this example, I'm calling it "pilot.png"

Alt text

  1. Now I need to say where this icon goes, so I open template.csv. I create a new row, type an element name (I'm calling it 'ImgSkill') and define some x and y coordinates, along with the width(w) and height(h) to display the image at in pixels. Alt text
  • Important: For image elements, the element value must start with 'Img'. For text elements, it must start with 'Text'.
  • Also Important: Currently, you must define an x, y, w, and h value for each element. For text, you also need to choose a size and font. hSquish, the percentage to squish the text by horizontally, is optional.
  1. Now I want to define what characters get to be pilots so I open content.csv. I create a new column and type the same Element name I created in templates.csv: 'ImgSkill'. For each card I want to make a pilot, I paste the filename of the pilot image. By leaving the others blank, they won't get the pilot icon. Alt text
  2. I save template.csv and content.csv.
  • Make sure to save these as .csv's if editing in Excel. Ignore the warning to save as xlsx.
  1. Now I open CardCreator.pde and hit the play button again. My updated cards should appear in the CardCreator folder. Since I said that Spy gets the pilot.png icon for her ImgSkill, she now has that icon. Tailor doesn't.

Alt text

About

A Processing script to automate Playing Card design

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published