Skip to content

Instantly share code, notes, and snippets.

@andymeneely
Last active March 16, 2016 03:08
Show Gist options
  • Save andymeneely/5026392a419124312cb7 to your computer and use it in GitHub Desktop.
Save andymeneely/5026392a419124312cb7 to your computer and use it in GitHub Desktop.
Squib Examples: From SSE presentation
require 'squib'
Squib::Deck.new cards: 1 do
background color: 'pink'
rect
text str: 'Draw two cards.'
save_png prefix: 'part1_', dir: '.'
end
require 'squib'
Squib::Deck.new cards: 1 do
background color: '#252322'
rect fill_color: '#0B3736',
x: 38, y: 38, width: 750, height: 1050, radius: 38
text str: 'Robot Golem', font: 'True Crimes, Sans 72',
align: :center, x: 75, width: :deck, color: '#DFDFE1', y: 90
svg file: 'auto-repair.svg', x: 75, y: 75, width: 100, height: :scale
svg file: 'robot-golem.svg', x: 75, y: 300, width: 675, height: :scale
text str: 'Draw two cards', font: 'Serif 36',
align: :center, width: :deck, color: '#DFDFE1', y: 1000
save_png prefix: 'part2_', dir: '.'
end
require 'squib'
Squib::Deck.new cards: 1, layout: 'part3_layout.yml' do
background color: '#252322'
rect layout: 'backdrop'
text str: 'Robot Golem', layout: 'title'
svg layout: 'drone'
svg file: 'robot-golem.svg', layout: 'art'
text str: 'Draw two cards.', layout: 'power'
save_png prefix: 'part3_', dir: '.'
end
require 'squib'
Squib::Deck.new cards: 2, layout: 'part3_layout.yml' do
background color: '#252322'
rect layout: 'backdrop'
text str: ['Robot Golem', 'Ninja'],
layout: 'title'
svg layout: ['drone', 'human']
svg file: ['robot-golem.svg','ninja-mask.svg'],
layout: 'art'
text str: ['Draw two cards',
'Use the power of another player'],
layout: 'power'
save_png prefix: 'part4_', dir: '.'
end
require 'squib'
Squib::Deck.new cards: 4, layout: 'part3_layout.yml' do
background color: '#252322'
rect layout: 'backdrop'
data = xlsx file: 'data.xlsx'
text str: data['name'], layout: 'title'
svg layout: data['class']
svg file: data['art'], layout: 'art'
text str: data['power'], layout: 'power'
save_png prefix: 'part5_', dir: '.'
hand file: 'part5_hand.png', dir: '.', trim_radius: 38
showcase file: 'part5_showcase.png', dir: '.'
end
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
backdrop:
fill_color: '#0B3736'
x: 38
y: 38
radius: 38
width: 750
height: 1050
title:
font: 'True Crimes, Sans 72'
align: center
color: '#DFDFE1'
x: 75
y: 90
width: 825
drone:
file: auto-repair.svg
x: 75
y: 75
width: 100
height: 100
human:
extends: drone
file: humans.svg
art:
x: 75
y: 300
width: 675
height: 675
power:
font: 'Serif 36'
align: center
width: 825
color: '#DFDFE1'
y: 1000
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment