Implementing initial layout functionality
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
frame:
|
||||
x: 38
|
||||
y: 38
|
||||
width: 750
|
||||
height: 1050
|
||||
title:
|
||||
x: 125
|
||||
y: 50
|
||||
width: 625
|
||||
height: 150
|
||||
subtitle:
|
||||
x: 125
|
||||
y: 150
|
||||
width: 625
|
||||
height: 150
|
||||
icon_left:
|
||||
x: 200
|
||||
y: 250
|
||||
width: 125
|
||||
height: 125
|
||||
icon_right:
|
||||
x: 400
|
||||
y: 250
|
||||
width: 125
|
||||
height: 125
|
||||
@@ -0,0 +1,21 @@
|
||||
require 'squib'
|
||||
|
||||
Squib::Deck.new(layout: 'custom-layout.yml') do
|
||||
background color: :white
|
||||
|
||||
# Layouts are YAML files that specify x, y, width, and height coordinates
|
||||
rect layout: :frame
|
||||
|
||||
# You can also override a given layout entry in the command
|
||||
rect layout: :frame, width: 50, height: 50
|
||||
|
||||
# Any command with x-y-width-height options, we can use a custom layout
|
||||
text str: 'The Title', layout: :title
|
||||
png file: 'shiny-purse.png', layout: :icon_left
|
||||
svg file: 'spanner.svg', layout: :icon_right
|
||||
|
||||
# Strings can also be used in layouts
|
||||
text str: 'subtitle', layout: 'subtitle'
|
||||
|
||||
save_png prefix: 'layout_'
|
||||
end
|
||||
Reference in New Issue
Block a user