Class: Nimo::QuadRepresentation
- Inherits:
-
ObjectRepresentation
- Object
- ObjectRepresentation
- Nimo::QuadRepresentation
- Defined in:
- lib/nimo/representations/quad_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/quad_representation.rb', line 5 def color @color end |
Instance Method Details
#draw ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/nimo/representations/quad_representation.rb', line 13 def draw @game_window.draw_quad( @game_object.x, @game_object.y, @color, @game_object.x + @game_object.width, @game_object.y, @color, @game_object.x, @game_object.y + @game_object.height, @color, @game_object.x + @game_object.width, @game_object.y + @game_object.height, @color) end |
#load(resources, params) ⇒ Object
7 8 9 10 11 |
# File 'lib/nimo/representations/quad_representation.rb', line 7 def load(resources, params) raise "Must provide :color param for quad loading" unless params.has_key?(:color) @color = params[:color] end |