Code Monkey home page Code Monkey logo

magic-card-creator's People

Contributors

barneyb avatar switzerb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

magic-card-creator's Issues

vertically center body text

If the card text doesn't use the whole card textbox area, it should be vertically centered w/in the box, instead of being up at the top edge.

phyrexian mana

Phyrexian mana creates the need for some new mana symbols, but that's it.

At some point this may matter; but for now this is just here as a reminder to not paint ourselves into a corner.

body text scaling

The card body text needs to be measured before rendering, and if it's too large, scaled back so it'll fit.

A box-level scaling operation would probably work, but reducing the font size and redrawing will give crisper resulting text, at the expense of fuzzier resulting symbols (because the symbols are pre-rasterized).

paintbrush 'icon' as vector

The paintbrush icon that indicates the card's artwork's artist needs to be vectorized so it can be applied to the card layouts. Deliverable is an SVG of that shape as a path (e.g, traced in Illustrator and exported or whatever).

tap symbol path

Currently the tap SVG icon is just the old-style rotated "T", not the folded arrow shape. It'd be better to have that arrow shape as a path to put on the icon instead of the T, but I can't draw it.

base card frames

Card frames are needed in a number of styles. The base set's naming follows this psuedo-EBNF:

name     := base ( "_" type)? ".png"
base     := color | "gold"
color  := "white" | "blue" | "black" | "red" | "green"
type   := "creature"

This describes 12 distinct frames (2 per color, 2 golds), encompasses the vast majority of existing cards. This is rich enough to describe the design of first 4-5 printed Magic editions.

card textures and colors

For each of the five colors plus gold, artifact, and land, there is a single color (used for borders) and four textures:

  • frame
  • title/type/pt bar
  • textbox

This gives 24 different textures, though they needn't necessarily all be different. For two-color cards, gold uses a gradient fade between the two colors for the textbox, but for 3+ color cards it uses a generic gold texture. Similarly, color-aligned lands use color-based textbox textures, but non-color-aligned lands use a generic land texture.

The 25th texture is the starfield frame for semi-enchantment cards that is laid across the top of the card's normal frame to indicate they they are both enchantments and something else.

Every texture is made up of six components, only the first of which is required:

  • a bitmap image (which can be partially transparent)
  • an opacity value for that image (default '1.0')
  • an under flood (default 'none')
  • an over flood (default 'none')
  • a bounding box (default is image size)
  • a color for overlaying text (default is black)

Each flood is a four-channel color (aRBG), allowing tinting of the actual raster without having to go crack it open in an image editor. The under flood can be used to tint the background behind the texture if the texture is only partially opaque.

The fill pattern is assembled by laying down the under flood, then the image with assigned opacity, then the over flood, and finally cropping based on the bounding box. This pattern is then tiled across whatever the texture is for.

The frame is 805x1155, the title bar is 80px tall, the type bar is 75px tall, the pt bar is 62px tall, and the textbox is 350x754.

Frames (including overlays) and textboxes have their first tile placed origin-aligned and then repeated down and right until the area is covered. Bars have their first tile placed center aligned (horizontally and vertically) and then repeated in all four directions until the area is covered.

To summarize, the deliverables are 8 RBG colors and 25 six-component textures.

colorless cost icons

Colorless cost icons need to be created for at least 0-9 and X mana, in both large (titlebar) and small (body) sizes.

Font

Goudy is pretty close to (if not exactly) the right font, but it measures wrong. Georgia is sorta close (and measures right) but is ugly. Need to figure out how to make that more gooder.

@switzerb says that a different version of Goudy (from Google?) might have better metrics and thus measure correctly.

newlines in body text

When body text contains newlines, they need to be considered split points as well as line wrap locations. Currently newlines are soaked up by the splitter, and don't make it to the composed card.

hybrid mana

Hybrid mana creates two extensions to card layouts:

  1. hybrid mana symbols
  2. hybrid card frames

At some point this may matter; but for now this is just here as a reminder to not paint ourselves into a corner.

Better line break handling

The default line break handling will wrap at the slash in a "-1/-1" string, which is fine for normal text, but not for card text, since that type of string is an atom of Magic parlance.

Fonts

Title, type, power/toughness, and artist should all be Matrix Bold

Body text and the footer line should be Garamond Regular (and Italic for flavor text).

colors

For each of the five colors, plus gold, artifact, and land, the border color needs to be specified in RGB.

extended card frames

To compare with current printed Magic editions, excepting hybrid and colored artifact cards, frames are needed in a lot of styles beyond what is described in #2. Naming follows the psuedo-EBNF:

name   := base ( "_" type )? ( "_" dual )?{base must be "gold" or "land"} ".png"
base   := color | "gold" | "artifact" | "land"
color  := "white" | "blue" | "black" | "red" | "green"
type   := "creature" | "enchantment_creature"
dual   := color "_" color{must be later in list}

Some examples, from simplest to most complex:

  • white.png a pure-white spell
  • blue_creature.png a pure-blue creature
  • gold_enchantment_creature_white_blue.png white-blue enchantment creature

Illegal examples:

  • artifact_white_blue.png base isn't gold or land
  • gold_blue_white.png dual is in the wrong order

Theoretically, there are 90 distinct frames (3 of each color, 3 artifacts, 33 golds and 33 lands), but most of them will remain unneeded/irrelevant for a long while (if not ever).

As noted above, this doesn't account for hybrid cards (which would require dual to be added as an alternative in the base rule) or colored artifact cards (which would require "artifact" to be added to the dual gate in the base rule). These are sufficiently esoteric uses that I think they can be ignored.

land in MD descriptors

Land don't have casting costs, which will currently cause misinterpretation of the card title in markdown desctriptors. that needs to be fixed.

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.