Class: LUIT::ClickPoint
- Inherits:
-
LUITElement
- Object
- LUITElement
- LUIT::ClickPoint
- Defined in:
- lib/luit.rb
Instance Attribute Summary
Attributes inherited from LUITElement
Instance Method Summary collapse
-
#initialize(holder, id, x, y, r) ⇒ ClickPoint
constructor
A new instance of ClickPoint.
- #update(x = 0, y = 0) ⇒ Object
Methods inherited from LUITElement
#button_down, #draw, #draw_rel, #updateHover, #update_rel
Constructor Details
#initialize(holder, id, x, y, r) ⇒ ClickPoint
Returns a new instance of ClickPoint.
195 196 197 198 |
# File 'lib/luit.rb', line 195 def initialize(holder, id, x, y, r) @r = [1, r].max super(holder, id, x - @r, y - @r, @r * 2, @r * 2) end |
Instance Method Details
#update(x = 0, y = 0) ⇒ Object
200 201 202 203 204 205 206 |
# File 'lib/luit.rb', line 200 def update(x = 0, y = 0) if Gosu::distance($mx, $my, x, y) <= @r @hover = true else @hover = false end end |