Browse Source

Starting a basic hand command

dev
Andy Meneely 11 years ago
parent
commit
f0f9b7680d
  1. 7
      lib/squib/api/save.rb
  2. 20
      samples/hand.rb
  3. 1
      squib.sublime-project

7
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

20
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

1
squib.sublime-project vendored

@ -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]",},

Loading…
Cancel
Save