Tons of text features and options added
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
module Squib
|
||||
class Deck
|
||||
|
||||
def hint(text: nil)
|
||||
@text_hint = colorify(text, nillable: true)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user