Browse Source

builtin layouts: party 🎉

Based on idea from #7
dev
Andy Meneely 8 years ago
parent
commit
9ff72b7066
  1. 1
      CHANGELOG.md
  2. 11
      docs/layouts.rst
  3. 94
      lib/squib/builtin/layouts/party.yml
  4. 23
      samples/layouts/builtin_layouts.rb
  5. BIN
      samples/layouts/expected_layouts_builtin_party_00.png

1
CHANGELOG.md

@ -12,6 +12,7 @@ Features:
* `save_pdf` method also supports `rtl` by @vador
* New DSL methods `safe_zone` and `cut_zone` will draw a rectangle inset from the margins for quick proof checking
* New "advanced" option for creating new projects, if you do `squib new --advanced yourgame` (@andymeneely)
* New built-in layout: `party.yml`. (@andymeneely)
Compatibility:
* DPI is correctly respected with font sizes now. To convert to Squib v0.14+, divide your old font sizes by 3 (precisely, 300/96=3.125). By @felixleong

11
docs/layouts.rst

@ -277,6 +277,17 @@ hand.yml
https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/hand.yml
party.yml
~~~~~~~~~
.. raw:: html
<img src="layouts/expected_layouts_builtin_party_00.png"
class="figure" width=350>
https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/party.yml
playing_card.yml
~~~~~~~~~~~~~~~~

94
lib/squib/builtin/layouts/party.yml

@ -0,0 +1,94 @@
#This layout inspired by popular games like Fluxx and Apples to Apples
title_box:
x: 75
y: 75
width: 125
height: 975
title:
x: 75
y: 1050
angle: 4.71238898 # 3 π / 2
width: 850
height: 125
align: right
valign: middle
font: Sans 22
title_middle:
x: 225
y: 550
font: Sans 18
width: 525
height: 150
valign: bottom
middle_rect:
x: 225
y: 715
width: 525
height: 25
rule_top:
x: 225
y: 200
width: 525
height: 300
font: Times New Roman, Serif 10
rule_bottom:
x: 225
y: 750
width: 525
height: 300
font: Times New Roman, Serif 10
type_icon:
x: 75
y: 75
width: 125
height: 125
align: center
valign: middle
font: 'Sans 24'
type:
x: 225
y: 75
width: 525
height: 125
align: left
valign: top
font: 'Sans 30'
copyright:
x: 75
y: 1025
width: 675
height: 25
font_size: 5
align: right
valign: bottom
#aliases for copyright
copy:
extends: copyright
credit:
extends: copyright
credits:
extends: copyright
# The "cut line", without rounded corners
cut:
x: 37.5
y: 37.5
radius: 16
width: 750
height: 1050
# The "safe zone" as defined by TheGameCrafter poker cards
safe:
x: 75
y: 75
width: 675
height: 975
dash: 3 3

23
samples/layouts/builtin_layouts.rb

@ -72,3 +72,26 @@ Squib::Deck.new(layout: 'tuck_box.yml', width: 2325, height: 1950) do
save_png prefix: 'layouts_builtin_tuck_box_'
end
Squib::Deck.new(layout: 'party.yml') do
background color: 'white'
# hint text: :black # uncomment to see the text box boundaries
rect layout: :title_box,
fill_color: :deep_sky_blue, stroke_width: 0
text str: "A SILLY NAME", layout: :title
text str: '✔', layout: :type_icon
text str: 'TYPE', layout: :type
text str: 'A Silly Name', layout: :title_middle
rect fill_color: :black, layout: :middle_rect
str = 'Rule or story text. Be funny ha ha ha this is a party.'
text str: str, layout: :rule_top
text str: str, layout: :rule_bottom
text str: 'Tiny text', layout: :copyright
rect layout: :safe
rect layout: :cut
save_png prefix: 'layouts_builtin_party_'
end

BIN
samples/layouts/expected_layouts_builtin_party_00.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Loading…
Cancel
Save