Coder Social home page Coder Social logo

nagyist / andrewalbers.cardcreator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrewalbers/cardcreator

0.0 2.0 0.0 3.86 MB

A Processing script to automate Playing Card design

License: GNU General Public License v2.0

Processing 100.00%

andrewalbers.cardcreator's Introduction

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

andrewalbers.cardcreator's People

Contributors

zebbeni avatar mars2klb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.