diff --git a/lib/squib/api/save.rb b/lib/squib/api/save.rb index ab1786c..6972a52 100644 --- a/lib/squib/api/save.rb +++ b/lib/squib/api/save.rb @@ -70,5 +70,12 @@ module Squib opts[:dir], opts[:file]) 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 diff --git a/samples/hand.rb b/samples/hand.rb new file mode 100644 index 0000000..fc3d4df --- /dev/null +++ b/samples/hand.rb @@ -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 + diff --git a/squib.sublime-project b/squib.sublime-project index 6b7be34..419ab95 100644 --- a/squib.sublime-project +++ b/squib.sublime-project @@ -16,6 +16,7 @@ {"name": "rake", "shell_cmd": "rake",}, {"name": "rake sanity", "shell_cmd": "rake sanity",}, {"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[csv_import]", "shell_cmd": "rake run[csv_import]",}, {"name": "rake run[custom_config]", "shell_cmd": "rake run[custom_config]",},