Class: Wads::Coordinates

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#heightObject

Returns the value of attribute height.



126
127
128
# File 'lib/wads/widgets.rb', line 126

def height
  @height
end

#widthObject

Returns the value of attribute width.



125
126
127
# File 'lib/wads/widgets.rb', line 125

def width
  @width
end

#xObject

Returns the value of attribute x.



123
124
125
# File 'lib/wads/widgets.rb', line 123

def x
  @x
end

#yObject

Returns the value of attribute y.



124
125
126
# File 'lib/wads/widgets.rb', line 124

def y
  @y
end