Class: Engine::UI::Rect

Inherits:
Struct
  • Object
show all
Defined in:
lib/engine/ui/rect.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bottomObject

Returns the value of attribute bottom

Returns:

  • (Object)

    the current value of bottom



5
6
7
# File 'lib/engine/ui/rect.rb', line 5

def bottom
  @bottom
end

#leftObject

Returns the value of attribute left

Returns:

  • (Object)

    the current value of left



5
6
7
# File 'lib/engine/ui/rect.rb', line 5

def left
  @left
end

#rightObject

Returns the value of attribute right

Returns:

  • (Object)

    the current value of right



5
6
7
# File 'lib/engine/ui/rect.rb', line 5

def right
  @right
end

#topObject

Returns the value of attribute top

Returns:

  • (Object)

    the current value of top



5
6
7
# File 'lib/engine/ui/rect.rb', line 5

def top
  @top
end

Instance Method Details

#heightObject



10
11
12
13
# File 'lib/engine/ui/rect.rb', line 10

def height
  # Y-down: bottom > top
  bottom - top
end

#widthObject



6
7
8
# File 'lib/engine/ui/rect.rb', line 6

def width
  right - left
end