-
Notifications
You must be signed in to change notification settings - Fork 67
Category specific template text
Let's say you have a deck with cards that are categorized by a column Type
, and you have per-type "flavor text" you'd like to include without repeating it in your source spreadsheet. You can create a Hash
of your flavor texts, like so:
flavortext = {
"creeper" => "You cannot hold this card, but must place it face up in front of you as soon as you get it.\nIf you drew it, immediately draw another card to replace it.",
"keeper" => "To play this card, place it face up on the table in front of you.",
"goal" => "To play this card, place it face up in the center of the table. Discard previous Goal, if any.",
"surprise" => "This card can be played at any time, for one of the functions described below, or to cancel a Surprise which another player has just played",
"action" => "To play this card, do whatever it says, then place it on the discard pile.",
"newrule" => "To play this card, place it face up in the center of the table. New rules take effect instantly."
}
Then, add an empty array to the data
hash in the Deck
block to hold the "flavor text", loop through the Type
s for each card, and push the matching flavor text into that empty array. Note, in this example, each card's Type
is converted to a slug by stripping spaces and lower-casing the text. If your Hash keys match the card's Type
, you don't need to do that, and can just replace the fetch with flavortext.fetch(thetype)
.
data['FlavorText'] = []
data['Type'].each do |thetype|
data['FlavorText'].push flavortext.fetch(thetype.downcase.sub(/\s/,''))
end
Now your data
hash includes an array of FlavorText
strings to match each card.
Install: Windows OSX Linux Cygwin
Getting Started
Important
Advanced Squibbing
- The Mighty text Method
- Layouts
- Manipulating PNGs
- Manipulating SVGs
- Vector back end
- Rendering both BW and Color
- Colors
- Configuration Options
Real Project Histories
Squiblets
- Category specific template text
- Combining Multiple Columns
- One Icon Per Location
- One Location, Multiple Icons
- Google Sheets
- Rake Rendering Modes
- Autoscale Fonts
- Marketing Materials
- Autobuild with Guardfiles
- Wireframing with an SVG Editor
- Front to Back Printing
- Versioning Practices
- Icon Library: FontAwesome
- Icon Library: GameIcons
- Combining Multiple Columns
- Combine Multiple CSV Files
- Switch card background or invert theme
Tools
Contributing