Module: Common
- Included in:
- Rubynk
- Defined in:
- lib/app.rb
Overview
Methods for general purpose
Instance Method Summary collapse
- #alert(message) ⇒ Object
- #black ⇒ Object
-
#over?(x, y, l, h) ⇒ Boolean
Check if “mouse” is hovering over given rectangle.
- #ynk_setup ⇒ Object
Instance Method Details
#alert(message) ⇒ Object
16 17 18 |
# File 'lib/app.rb', line 16 def alert() $window.alert() end |
#black ⇒ Object
20 21 22 |
# File 'lib/app.rb', line 20 def black $p.background(1) end |
#over?(x, y, l, h) ⇒ Boolean
Check if “mouse” is hovering over given rectangle
25 26 27 28 29 30 |
# File 'lib/app.rb', line 25 def over?(x,y,l,h) true if $p.mouseX >= x && $p.mouseX <= l+x && $p.mouseY >= y && $p.mouseY <= h+y end |
#ynk_setup ⇒ Object
11 12 13 14 |
# File 'lib/app.rb', line 11 def ynk_setup $window = Native(`window`) # Get Page Window $p = Native(`p`) #Set global Processing hook end |