Starting a basic hand command

dev
Andy Meneely 2015-05-11 23:30:30 -04:00
parent 071f06bdc2
commit f0f9b7680d
3 changed files with 28 additions and 0 deletions

View File

@ -70,5 +70,12 @@ module Squib
opts[:dir], opts[:file]) opts[:dir], opts[:file])
end end
def hand(opts = {})
opts = {file: 'hand.png', fill_color: :white}.merge(opts)
opts = needs(opts,[:range, :margin, :trim, :trim_radius, :creatable_dir, :file_to_save])
render_hand()
end
end end
end end

20
samples/hand.rb Normal file
View File

@ -0,0 +1,20 @@
require 'squib'
# Built-in layouts are easy to use and extend
Squib::Deck.new(cards: 8, layout: 'playing-card.yml') do
# background color: :white
# rect x: 37, y: 37, width: 750, height: 1050, fill_color: :black
# rect x: 75, y: 75, width: 675, height: 975, fill_color: :white
# text str: ('A'..'H').to_a, layout: :bonus_ul, font: 'Sans bold 100'
# def helper(a)
# puts a
# end
# helper('abc')
# helper('def')
# # hand range: :all,
# # center_x: :auto, center_y: :auto,
# # angle_start: 0, angle_end: Math::PI,
# # width: :auto, height: :auto,
# save_png prefix: 'hand_'
end

View File

@ -16,6 +16,7 @@
{"name": "rake", "shell_cmd": "rake",}, {"name": "rake", "shell_cmd": "rake",},
{"name": "rake sanity", "shell_cmd": "rake sanity",}, {"name": "rake sanity", "shell_cmd": "rake sanity",},
{"name": "rake spec_fastonly", "shell_cmd": "rake spec_fastonly",}, {"name": "rake spec_fastonly", "shell_cmd": "rake spec_fastonly",},
{"name": "rake run[hand]", "shell_cmd": "rake run[hand]",},
{"name": "rake run[config_text_markup]", "shell_cmd": "rake run[config_text_markup]",}, {"name": "rake run[config_text_markup]", "shell_cmd": "rake run[config_text_markup]",},
{"name": "rake run[csv_import]", "shell_cmd": "rake run[csv_import]",}, {"name": "rake run[csv_import]", "shell_cmd": "rake run[csv_import]",},
{"name": "rake run[custom_config]", "shell_cmd": "rake run[custom_config]",}, {"name": "rake run[custom_config]", "shell_cmd": "rake run[custom_config]",},