samples: reorganize for better sanity
Converted to a more consistent organization of each folder for groups of samples Contributes to #118
@@ -0,0 +1,9 @@
|
||||
# Squib Samples
|
||||
|
||||
In here we have a massive library of Squib samples. We try to exercise as many options as possible here as these samples also serve as Squib's regression test suite.
|
||||
|
||||
If you have one to contribute, file an issue!
|
||||
|
||||
# What's with the underscores?
|
||||
|
||||
Normally you don't start a filename with an underscore (e.g. `_text.rb`), but to make it easier to find the code itself on GitHub, we've renamed the files so they sort to the top of the list.
|
||||
@@ -25,5 +25,5 @@ Squib::Deck.new(width: 300, height: 100, cards: 3) do
|
||||
text str: title, font: 'Arial', font_size: autoscale(title),
|
||||
x: 10, y:10, align: :center, width: 280, ellipsize: false, hint: :red
|
||||
|
||||
save_sheet dir: '.', columns: 3
|
||||
save_sheet columns: 3
|
||||
end
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -7,16 +7,16 @@ Squib::Deck.new(width: 75, height: 75, cards: 2) do
|
||||
|
||||
build :print_n_play do
|
||||
rect
|
||||
save_sheet dir: '.', prefix: 'build_groups_bw_'
|
||||
save_sheet prefix: 'build_groups_bw_'
|
||||
end
|
||||
|
||||
build :color do
|
||||
rect stroke_color: :red, dash: '5 5'
|
||||
save_png dir: '.', prefix: 'build_groups_color_'
|
||||
save_png prefix: 'build_groups_color_'
|
||||
end
|
||||
|
||||
build :test do
|
||||
save_png range: 0, dir: '.', prefix: 'build_groups_'
|
||||
save_png range: 0, prefix: 'build_groups_'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -20,6 +20,7 @@ end
|
||||
|
||||
# This script generates a table of the built-in constants
|
||||
Squib::Deck.new(width: 3000, height: 1500) do
|
||||
background color: :white
|
||||
colors = (Cairo::Color.constants - %i(HEX_RE Base RGB CMYK HSV X11))
|
||||
colors.sort_by! {|c| Cairo::Color.parse(c).to_s}
|
||||
x, y, w, h = 0, 0, 300, 50
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 13 KiB |
@@ -100,5 +100,5 @@ Squib::Deck.new(width: 1000, height: 3000) do
|
||||
end
|
||||
|
||||
|
||||
save_png prefix: '_images_', dir: '.'
|
||||
save_png prefix: '_images_'
|
||||
end
|
||||
|
||||
@@ -4,6 +4,5 @@ Squib::Deck.new cards: 1 do
|
||||
background color: 'pink'
|
||||
rect
|
||||
text str: 'Draw two cards.'
|
||||
save_png prefix: 'part1_', dir: '.'
|
||||
save_png prefix: 'part1_'
|
||||
end
|
||||
|
||||
|
||||
@@ -10,6 +10,5 @@ Squib::Deck.new cards: 1 do
|
||||
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: '.'
|
||||
save_png prefix: 'part2_'
|
||||
end
|
||||
|
||||
|
||||
@@ -7,6 +7,5 @@ Squib::Deck.new cards: 1, layout: 'part3_layout.yml' do
|
||||
svg layout: 'drone'
|
||||
svg file: 'robot-golem.svg', layout: 'art'
|
||||
text str: 'Draw two cards.', layout: 'power'
|
||||
save_png prefix: 'part3_', dir: '.'
|
||||
save_png prefix: 'part3_'
|
||||
end
|
||||
|
||||
|
||||
@@ -11,6 +11,5 @@ Squib::Deck.new cards: 2, layout: 'part3_layout.yml' do
|
||||
text str: ['Draw two cards',
|
||||
'Use the power of another player'],
|
||||
layout: 'power'
|
||||
save_png prefix: 'part4_', dir: '.'
|
||||
save_png prefix: 'part4_'
|
||||
end
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ Squib::Deck.new cards: 4, layout: 'part3_layout.yml' do
|
||||
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: '.'
|
||||
save_png prefix: 'part5_'
|
||||
hand file: 'part5_hand.png', trim_radius: 38
|
||||
showcase file: 'part5_showcase.png'
|
||||
end
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="747.59235"
|
||||
height="747.39734"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
sodipodi:docname="offset.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.76264655"
|
||||
inkscape:cx="373.79617"
|
||||
inkscape:cy="373.69867"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1440"
|
||||
inkscape:window-height="776"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(5.1573995,-302.70286)">
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
id="thing"
|
||||
sodipodi:cx="159.99248"
|
||||
sodipodi:cy="152.67546"
|
||||
sodipodi:rx="59.401001"
|
||||
sodipodi:ry="59.401001"
|
||||
d="m 219.39348,152.67546 c 0,32.80627 -26.59474,59.401 -59.401,59.401 -32.80627,0 -59.401,-26.59473 -59.401,-59.401 0,-32.80627 26.59473,-59.401 59.401,-59.401 32.80626,0 59.401,26.59473 59.401,59.401 z"
|
||||
transform="matrix(0.95784259,0,0,0.95784259,531.73189,844.72627)"
|
||||
inkscape:label="thing" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -9,10 +9,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do
|
||||
text str: 'Mastermind', x: 220, y: 78, font: 'Arial 54'
|
||||
text str: 3, x: 75, y: 85, width: 128, font: 'Arial 72', align: :center
|
||||
|
||||
png file: 'shiny-purse.png', x: 620, y: 75
|
||||
svg file: 'spanner.svg', x: 620, y: 218
|
||||
|
||||
# TGC proof overlay
|
||||
# TGC proof overlay (using alpha-transparency)
|
||||
png file: 'pokercard.png', x:0, y:0, alpha: 0.5
|
||||
|
||||
save_png prefix: 'tgc_sample_'
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
@@ -116,6 +116,7 @@ Squib::Deck.new do
|
||||
end
|
||||
|
||||
Squib::Deck.new(cards: 3) do
|
||||
background color: :white
|
||||
str = 'Take 1 :tool: and gain 2 :health:.'
|
||||
text(str: str, font: 'Sans', font_size: [18, 26, 35],
|
||||
x: 0, y: 0, width: 180, height: 300, valign: :bottom,
|
||||
@@ -43,5 +43,5 @@ Squib::Deck.new(width: 1000, height: 1250) do
|
||||
text str: 'Rotated', hint: :red, x: x, y: y, angle: Math::PI / 6
|
||||
end
|
||||
|
||||
save_png prefix: '_text_', dir: '.'
|
||||
save_png prefix: '_text_'
|
||||
end
|
||||
|
||||
@@ -98,5 +98,5 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
|
||||
valign: :bottom,
|
||||
font: 'Serif 18', hint: :cyan
|
||||
|
||||
save prefix: 'text_', format: :png
|
||||
save prefix: 'text_options_', format: :png
|
||||
end
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 128 128"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.3.1 r9886"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="spanner.svg">
|
||||
<metadata
|
||||
id="metadata18">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs16" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:window-height="1002"
|
||||
id="namedview14"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.8284271"
|
||||
inkscape:cx="98.928938"
|
||||
inkscape:cy="62.194589"
|
||||
inkscape:window-x="1912"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g3767"
|
||||
inkscape:document-units="in"
|
||||
units="px"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true" />
|
||||
<g
|
||||
id="g3767"
|
||||
transform="matrix(0.24961486,0,0,0.24961486,0.197194,96.049335)">
|
||||
<rect
|
||||
ry="67.108368"
|
||||
y="-378.68747"
|
||||
x="5.3126979"
|
||||
height="501.3746"
|
||||
width="501.3746"
|
||||
id="backdrop"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10.62539577;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
|
||||
inkscape:label="#rect3765" />
|
||||
<path
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
d="M 36.267098,-7.709219 C 16.393265,5.1318032 3.2161811,27.462365 3.2161811,52.884128 c 0,39.825874 32.2852369,72.111092 72.1110909,72.111092 23.870397,0 44.964938,-11.67699 58.089488,-29.545518 -11.26063,7.275808 -24.65607,11.517748 -39.060173,11.517748 -39.825853,0 -72.11109,-32.285221 -72.11109,-72.111095 0,-15.95546 5.248882,-30.6218942 14.021601,-42.565574 z"
|
||||
id="path3790"
|
||||
inkscape:connector-curvature="0" />
|
||||
<g
|
||||
id="g6"
|
||||
transform="matrix(18.68858,0,0,18.68858,-3385.6437,-2608.3849)">
|
||||
<path
|
||||
style="fill:#ffffff"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path8"
|
||||
d="m 192.2325,129.3203 -10,10 v 5.5625 h 5.375 l 10.0938,-10.0938 -5.4688,-5.4688 z" />
|
||||
<path
|
||||
style="fill:#ffffff;stroke:#000000"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path10"
|
||||
d="m 181.7796,141.8591 15.6196,-15.6178 m 3.349,3.3486 -15.8051,15.8032" />
|
||||
<path
|
||||
style="fill:#ffffff"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path12"
|
||||
d="m 201.2023,119.7104 c -2.8283,-0.73 -5.9623,-0.004 -8.1759,2.2097 -3.3293,3.3292 -3.3293,8.7358 -2e-5,12.065 3.32928,3.3292 8.7358,3.3292 12.065,0 2.216,-2.216 2.9436,-5.3452 2.2097,-8.1759 l -5.6348,5.6348 -4.8172,-1.2816 -1.2816,-4.8171 5.6348,-5.6348 z" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |