Class: Wads::Coordinates
- Inherits:
-
Object
- Object
- Wads::Coordinates
- Defined in:
- lib/wads/widgets.rb
Overview
An instance of Coordinates references an x, y position on the screen as well as the width and height of the widget, thus providing the outer dimensions of a rectangular widget.
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, w, h) ⇒ Coordinates
constructor
A new instance of Coordinates.
Constructor Details
#initialize(x, y, w, h) ⇒ Coordinates
Returns a new instance of Coordinates.
127 128 129 130 131 132 |
# File 'lib/wads/widgets.rb', line 127 def initialize(x, y, w, h) @x = x @y = y @width = w @height = h end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
126 127 128 |
# File 'lib/wads/widgets.rb', line 126 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
125 126 127 |
# File 'lib/wads/widgets.rb', line 125 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
123 124 125 |
# File 'lib/wads/widgets.rb', line 123 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
124 125 126 |
# File 'lib/wads/widgets.rb', line 124 def y @y end |