Class: Nimo::TextRepresentation
- Inherits:
-
ObjectRepresentation
- Object
- ObjectRepresentation
- Nimo::TextRepresentation
- Defined in:
- lib/nimo/representations/text_representation.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
Attributes inherited from ObjectRepresentation
Instance Method Summary collapse
Methods inherited from ObjectRepresentation
#act_upon, #always, #initialize, #listen_to, #update, #with_observer
Methods included from InputListener
#any_key, #button_down, #process_inputs, #when_key
Methods included from EventListener
Constructor Details
This class inherits a constructor from Nimo::ObjectRepresentation
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
5 6 7 |
# File 'lib/nimo/representations/text_representation.rb', line 5 def color @color end |
Instance Method Details
#draw ⇒ Object
15 16 17 |
# File 'lib/nimo/representations/text_representation.rb', line 15 def draw @font.draw(@text, @game_object.x, @game_object.y, 0, 1, 1, @color) end |
#load(resources, params) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/nimo/representations/text_representation.rb', line 7 def load(resources, params) validate(params) @font = resources.font(params[:font]) @color = params[:color] @text = params[:text] # TODO Or should it get it from the game_object? end |