Class: FontStyle
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#font ⇒ Object
Returns the value of attribute font.
-
#name ⇒ Object
Returns the value of attribute name.
-
#size ⇒ Object
Returns the value of attribute size.
-
#x_scale ⇒ Object
Returns the value of attribute x_scale.
-
#y_scale ⇒ Object
Returns the value of attribute y_scale.
Instance Method Summary collapse
- #calc_width(text) ⇒ Object
- #configure(name, size, color, x_scale, y_scale) ⇒ Object
- #height ⇒ Object
- #reload ⇒ Object
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
5 6 7 |
# File 'lib/gamebox/core/font_style.rb', line 5 def color @color end |
#font ⇒ Object
Returns the value of attribute font.
5 6 7 |
# File 'lib/gamebox/core/font_style.rb', line 5 def font @font end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/gamebox/core/font_style.rb', line 5 def name @name end |
#size ⇒ Object
Returns the value of attribute size.
5 6 7 |
# File 'lib/gamebox/core/font_style.rb', line 5 def size @size end |
#x_scale ⇒ Object
Returns the value of attribute x_scale.
5 6 7 |
# File 'lib/gamebox/core/font_style.rb', line 5 def x_scale @x_scale end |
#y_scale ⇒ Object
Returns the value of attribute y_scale.
5 6 7 |
# File 'lib/gamebox/core/font_style.rb', line 5 def y_scale @y_scale end |
Instance Method Details
#calc_width(text) ⇒ Object
15 16 17 |
# File 'lib/gamebox/core/font_style.rb', line 15 def calc_width(text) @font.text_width text if @font end |
#configure(name, size, color, x_scale, y_scale) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/gamebox/core/font_style.rb', line 6 def configure(name, size, color, x_scale, y_scale) @name = name @size = size @color = color @x_scale = x_scale @y_scale = y_scale reload end |
#height ⇒ Object
19 20 21 |
# File 'lib/gamebox/core/font_style.rb', line 19 def height @font.height if @font end |
#reload ⇒ Object
23 24 25 |
# File 'lib/gamebox/core/font_style.rb', line 23 def reload @font = resource_manager.load_font name, size end |