👮 leading space in comments
This commit is contained in:
@@ -36,7 +36,7 @@ Squib::Deck.new do
|
||||
star x: 300, y: 1000, n: 5, inner_radius: 15, outer_radius: 40,
|
||||
fill_color: :cyan, stroke_color: :burgundy, stroke_width: 5
|
||||
|
||||
#default draw is fill-then-stroke. Can be changed to stroke-then-fill
|
||||
# default draw is fill-then-stroke. Can be changed to stroke-then-fill
|
||||
star x: 375, y: 1000, n: 5, inner_radius: 15, outer_radius: 40,
|
||||
fill_color: :cyan, stroke_color: :burgundy,
|
||||
stroke_width: 5, stroke_strategy: :stroke_first
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ Squib::Deck.new(cards: 3) do
|
||||
text str: data['Level'], x: 65, y: 65, font: 'Arial 72'
|
||||
text str: data['Description'], x: 65, y: 600, font: 'Arial 36'
|
||||
|
||||
save format: :png, prefix: 'sample_excel_' #save to individual pngs
|
||||
save format: :png, prefix: 'sample_excel_' # save to individual pngs
|
||||
end
|
||||
|
||||
# xlsx is also a Squib-module-level function, so this also works:
|
||||
@@ -51,5 +51,5 @@ Squib::Deck.new(cards: resource_data['Name'].size) do
|
||||
rect width: :deck, height: :deck
|
||||
text str: resource_data['Name'], align: :center, width: :deck, hint: 'red'
|
||||
text str: resource_data['Cost'], align: :right, width: :deck, hint: 'red'
|
||||
save_sheet prefix: 'sample_excel_resources_' #save to a whole sheet
|
||||
save_sheet prefix: 'sample_excel_resources_' # save to a whole sheet
|
||||
end
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ Squib::Deck.new(cards: 8, layout: 'playing-card.yml') do
|
||||
text str: ('A'..'Z').to_a, layout: :bonus_ul, font: 'Sans bold 100'
|
||||
|
||||
# Defaults are sensible
|
||||
hand #saves to _output/hand.png
|
||||
hand # saves to _output/hand.png
|
||||
|
||||
# Here's a prettier version:
|
||||
# - Each card is trimmed with rounded corners
|
||||
|
||||
@@ -10,7 +10,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1, config: 'load_images_config.
|
||||
# Can be scaled if width and height are set
|
||||
svg file: 'spanner.svg', x: 50, y: 50, width: 250, height: 250
|
||||
png file: 'shiny-purse.png', x: 305, y: 50, width: 250, height: 250
|
||||
#...but PNGs will warn if it's an upscale, unless you disable them in config.yml
|
||||
# ...but PNGs will warn if it's an upscale, unless you disable them in config.yml
|
||||
|
||||
# Can be scaled using just width or height, if one of them is set to :scale
|
||||
svg file: 'spanner.svg', x: 200, y: 350, width: 35, height: :scale
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
x:25, y: 500
|
||||
|
||||
# Useful idiom: draw a different number of images for different cards
|
||||
hearts = [nil, 1, 2] #i.e. card 0 has no hearts, card 2 has 2 hearts drawn
|
||||
hearts = [nil, 1, 2] # i.e. card 0 has no hearts, card 2 has 2 hearts drawn
|
||||
1.upto(2).each do |n|
|
||||
range = hearts.each_index.select { |i| hearts[i] == n}
|
||||
n.times do |i|
|
||||
|
||||
Reference in New Issue
Block a user