Tons of documentation work

This commit is contained in:
Andy Meneely
2014-07-21 17:02:34 -04:00
parent 209b4240eb
commit d34e4729ce
21 changed files with 292 additions and 48 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
png range: [0,2], file: 'shiny-purse.png', x: 620, y: 75
svg range: 1..2, file: 'spanner.svg', x: 620, y: 218
save format: :png
save prefix: 'basic_', format: :png
end
puts "Done!"
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require 'squib'
Squib::Deck.new do
text str: 'Hello, World!'
save_png
end
+12 -3
View File
@@ -12,15 +12,24 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
text str: data['level'], x: 65, y: 40, font: 'Arial 72'
# Could be explicit about using :all, too
text range: :all, str: data['type'], x: 50, y: 128, font: 'Arial 18'
text range: :all,
str: data['type'], x: 40, y: 128, font: 'Arial 18',
width: 100, align: :center
# Ranges are inclusive
# Ranges are inclusive, zero-based
text range: 0..1, str: "Thief and Grifter only!!", x: 25, y:200
# Integers are also allowed
text range: 0, str: "Thief only!", x: 25, y: 250
# Negatives go from the back of the deck
text range: -1, str: "Mastermind only!", x: 25, y: 250
text range: -2..-1, str: "Grifter and Mastermind only!", x: 25, y: 650
# We can use Arrays too!
text range: [0,2], str: "Thief and Mastermind only!!", x: 25, y:300
# Useful idiom: construct a hash from card names back to id,
# Useful idiom: construct a hash from card names back to its index (ID),
# then use a range. No need to memorize IDs, and you can add cards easily
id = {} ; data['name'].each_with_index{ |name,i| id[name] = i}
text range: id['Thief']..id['Grifter'],
+14
View File
@@ -0,0 +1,14 @@
require 'squib'
Squib::Deck.new(width: 825, height: 1125, cards: 3) do
background color: :white
bleed = inches(0.125)
cut_width = inches(2.5)
cut_height = inches(3.5)
rect x: bleed, y: bleed, width: cut_width, height: cut_height, radius: 25
save prefix: 'units_', format: :png
end
puts "Done!"