Class: Metro::UI::Rectangle
- Defined in:
- lib/metro/models/ui/rectangle.rb
Overview
The rectangle will draw a rectangle from the specified position out to the specified dimensions in the specified color.
Constant Summary
Constants included from Metro::Units
Instance Attribute Summary collapse
-
#color ⇒ Object
The color to rectangle.
-
#dimensions ⇒ Object
The dimensions of the rectangle.
-
#position ⇒ Object
The position of the upper-left corner of the rectangle.
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Model
#_load, #_save, #after_initialize, #bounds, #create, #draw_completed?, hierarchy, inherited, #initialize, metro_name, #model, model_name, models, #name, #notification, #saveable_to_view, #show, #to_hash, #update, #update_completed?
Methods included from HasEvents
Methods included from KeyValueCoding
Methods included from PropertyOwner
Constructor Details
This class inherits a constructor from Metro::Model
Instance Attribute Details
#color ⇒ Object
The color to rectangle
23 |
# File 'lib/metro/models/ui/rectangle.rb', line 23 property :color |
#dimensions ⇒ Object
The dimensions of the rectangle
27 28 29 |
# File 'lib/metro/models/ui/rectangle.rb', line 27 property :dimensions do window.dimensions end |
#position ⇒ Object
The position of the upper-left corner of the rectangle
19 |
# File 'lib/metro/models/ui/rectangle.rb', line 19 property :position |
Instance Method Details
#draw ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/metro/models/ui/rectangle.rb', line 31 def draw window.draw_quad(left_x,top_y,color, right_x,top_y,color, right_x,bottom_y,color, left_x,bottom_y,color, z_order) end |