Added support for merging multiple layout files

This commit is contained in:
Andy Meneely
2014-11-17 21:08:57 -05:00
parent dbc1b6eab3
commit 75ab0b565f
11 changed files with 122 additions and 8 deletions
+1
View File
@@ -1,3 +1,4 @@
# Used in the layouts.rb sample in conjunction with custom-layout2.yml
frame:
x: 38
y: 38
+15
View File
@@ -0,0 +1,15 @@
# Used in the layouts.rb sample in conjunction with custom-layout.yml
#
# When used with custom-layout.yml loaded first, this layout overrides subtitle
subtitle:
x: 150
y: 150
width: 575
height: 60
align: left
valign: middle
font_size: 25
# This one is completely new
description:
extends: subtitle
y: += 350
+7
View File
@@ -32,3 +32,10 @@ Squib::Deck.new(layout: 'custom-layout.yml') do
save_png prefix: 'layout_'
end
Squib::Deck.new(layout:['custom-layout.yml', 'custom-layout2.yml']) do
text str: 'The Title', layout: :title # from custom-layout.yml
text str: 'The Subtitle', layout: :subtitle # redefined in custom-layout2.yml
text str: 'The Description', layout: :description # from custom-layout2.yml
save_png prefix: 'layout2_'
end