Tons of text features and options added

This commit is contained in:
Andy Meneely
2014-07-17 15:24:55 -04:00
parent c477432239
commit 9da4d0a499
9 changed files with 183 additions and 43 deletions
+9
View File
@@ -0,0 +1,9 @@
module Squib
class Deck
def hint(text: nil)
@text_hint = colorify(text, nillable: true)
end
end
end
+3 -2
View File
@@ -2,10 +2,11 @@ module Squib
class Deck
def rect(range: :all, x: 0, y: 0, width: 825, height: 1125, \
x_radius: 0, y_radius: 0)
x_radius: 0, y_radius: 0, color: :black)
range = rangeify(range)
color = colorify(color)
range.each do |i|
@cards[i].draw_rectangle(x, y, width, height, x_radius, y_radius)
@cards[i].draw_rectangle(x, y, width, height, x_radius, y_radius, color)
end
end
+2 -6
View File
@@ -1,10 +1,5 @@
module Squib
class Deck
def fontify (font)
font = 'Arial 36' if font==:use_set
font
end
def font(type: 'Arial', size: 12, **options)
raise 'Not implemented!'
end
@@ -17,7 +12,8 @@ module Squib
range = rangeify(range)
str = [str] * @cards.size unless str.respond_to? :each
font = fontify(font)
color = colorify(options[:color])
color = colorify(options[:color], nillable: false)
options['hint'] = colorify(options['hint']) unless options['hint'].nil?
range.each do |i|
cards[i].text(str[i], font, x, y, color, options)
end