Class: Rong::Client::DrawableElement
- Inherits:
-
Object
- Object
- Rong::Client::DrawableElement
- Defined in:
- lib/rong/client/drawable_element.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
-
#z_index ⇒ Object
readonly
Returns the value of attribute z_index.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(window, element, color = Gosu::Color::WHITE, z_index = Window::ZIndex::FOREGROUND) ⇒ DrawableElement
constructor
A new instance of DrawableElement.
Constructor Details
#initialize(window, element, color = Gosu::Color::WHITE, z_index = Window::ZIndex::FOREGROUND) ⇒ DrawableElement
Returns a new instance of DrawableElement.
6 7 8 9 10 11 |
# File 'lib/rong/client/drawable_element.rb', line 6 def initialize(window, element, color = Gosu::Color::WHITE, z_index = Window::ZIndex::FOREGROUND) @window = window @element = element @color = color @z_index = z_index end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
4 5 6 |
# File 'lib/rong/client/drawable_element.rb', line 4 def color @color end |
#element ⇒ Object (readonly)
Returns the value of attribute element.
4 5 6 |
# File 'lib/rong/client/drawable_element.rb', line 4 def element @element end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
4 5 6 |
# File 'lib/rong/client/drawable_element.rb', line 4 def window @window end |
#z_index ⇒ Object (readonly)
Returns the value of attribute z_index.
4 5 6 |
# File 'lib/rong/client/drawable_element.rb', line 4 def z_index @z_index end |
Instance Method Details
#draw ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rong/client/drawable_element.rb', line 13 def draw window.draw_quad(element.left, element.top, color, element.left, element.bottom, color, element.right, element.bottom, color, element.right, element.top, color, z_index) end |