Class: Cukunity::Unity::Screen
- Inherits:
-
JSONContainer
- Object
- JSONContainer
- Cukunity::Unity::Screen
- Defined in:
- lib/cukunity/unity/screen.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Attributes inherited from JSONContainer
Instance Method Summary collapse
-
#initialize(client, *args) ⇒ Screen
constructor
A new instance of Screen.
- #tap(pos, options = {}) ⇒ Object
- #touch_down(pos, options = {}) ⇒ Object
- #touch_move(pos, options = {}) ⇒ Object
- #touch_release(pos, options = {}) ⇒ Object (also: #touch_up)
Methods inherited from JSONContainer
#has_key?, #keys, #method_missing, #to_s, #value_of
Methods included from Cukunity::Utils
#check_timeout, #merge_options, #restrict_options, #to_options, #wait_connectivity
Constructor Details
#initialize(client, *args) ⇒ Screen
Returns a new instance of Screen.
6 7 8 9 |
# File 'lib/cukunity/unity/screen.rb', line 6 def initialize(client, *args) @client = client super(*args) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Cukunity::Unity::JSONContainer
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/cukunity/unity/screen.rb', line 4 def client @client end |
Instance Method Details
#tap(pos, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/cukunity/unity/screen.rb', line 11 def tap(pos, = {}) = invert_y(pos, ) [:type] = :tap client.platform::TouchInput.touch_screen() end |
#touch_down(pos, options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/cukunity/unity/screen.rb', line 17 def touch_down(pos, = {}) = invert_y(pos, ) [:down] = :down client.platform::TouchInput.touch_screen() end |
#touch_move(pos, options = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/cukunity/unity/screen.rb', line 29 def touch_move(pos, = {}) = invert_y(pos, ) [:move] = :move client.platform::TouchInput.touch_screen() end |
#touch_release(pos, options = {}) ⇒ Object Also known as: touch_up
23 24 25 26 27 |
# File 'lib/cukunity/unity/screen.rb', line 23 def touch_release(pos, = {}) = invert_y(pos, ) [:up] = :up client.platform::TouchInput.touch_screen() end |