feature: add use_layout method to load layouts at runtime

Closes #141
This commit is contained in:
Andy Meneely
2016-03-16 17:05:07 -04:00
parent b74fbf5787
commit 955d64a01f
5 changed files with 47 additions and 3 deletions
+10
View File
@@ -60,3 +60,13 @@ Squib::Deck.new(layout: 'hand.yml') do
png file: 'pokercard.png', alpha: 0.5
save_png prefix: 'layout_builtin_hand_'
end
# Layouts can also be specified in their own DSL method call
# Each layout call will progressively be merged with the priors
Squib::Deck.new do
use_layout file: 'custom-layout.yml'
use_layout file: 'custom-layout2.yml'
text str: 'The Title', layout: :title # from custom-layout.yml
text str: 'The Subtitle',layout: :subtitle # redefined in custom-layout2.yml
save_png prefix: 'layout3_'
end