Class: Moon::Input::Mouse

Inherits:
Object show all
Defined in:
lib/moon/packages/std/input.rb

Instance Method Summary collapse

Instance Method Details

#in_area?(x, y, w, h) ⇒ Boolean

Returns:


41
42
43
# File 'lib/moon/packages/std/input.rb', line 41

def in_area?(x, y, w, h)
  self.x.between?(x, x + w) && self.y.between?(y, y + h)
end

#in_rect?(rect) ⇒ Boolean

Returns:


45
46
47
# File 'lib/moon/packages/std/input.rb', line 45

def in_rect?(rect)
  in_area? rect.x, rect.y, rect.w, rect.h
end