Class: Rubygoo::DelayedText
- Inherits:
-
Object
- Object
- Rubygoo::DelayedText
- Defined in:
- lib/rubygoo/adapters/gosu_render_adapter.rb
Instance Method Summary collapse
- #draw(x, y, z, r, g, b) ⇒ Object
- #height ⇒ Object
-
#initialize(font, text) ⇒ DelayedText
constructor
A new instance of DelayedText.
- #width ⇒ Object
Constructor Details
#initialize(font, text) ⇒ DelayedText
Returns a new instance of DelayedText.
3 4 5 |
# File 'lib/rubygoo/adapters/gosu_render_adapter.rb', line 3 def initialize(font, text) @font, @text = font, text end |
Instance Method Details
#draw(x, y, z, r, g, b) ⇒ Object
6 |
# File 'lib/rubygoo/adapters/gosu_render_adapter.rb', line 6 def draw(x, y, z, r, g, b); @font.draw(@text, x, y, z); end |
#height ⇒ Object
10 11 12 |
# File 'lib/rubygoo/adapters/gosu_render_adapter.rb', line 10 def height() @height ||= @font.height end |
#width ⇒ Object
7 8 9 |
# File 'lib/rubygoo/adapters/gosu_render_adapter.rb', line 7 def width() @width ||= @font.text_width(@text).ceil end |