diff --git a/CHANGELOG.md b/CHANGELOG.md index e605a12..824128a 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/docs/layouts.rst b/docs/layouts.rst index b936f05..05e1463 100644 --- a/docs/layouts.rst +++ b/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 + + + +https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/party.yml + playing_card.yml ~~~~~~~~~~~~~~~~ diff --git a/lib/squib/builtin/layouts/party.yml b/lib/squib/builtin/layouts/party.yml new file mode 100644 index 0000000..74adea4 --- /dev/null +++ b/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 diff --git a/samples/layouts/builtin_layouts.rb b/samples/layouts/builtin_layouts.rb index ffbd1be..99fc1e8 100644 --- a/samples/layouts/builtin_layouts.rb +++ b/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 diff --git a/samples/layouts/expected_layouts_builtin_party_00.png b/samples/layouts/expected_layouts_builtin_party_00.png new file mode 100644 index 0000000..014267f Binary files /dev/null and b/samples/layouts/expected_layouts_builtin_party_00.png differ