Class: UnderOs::UI::Events::TouchListeners::Touch
- Defined in:
- lib/under_os/ui/utils/events.rb
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
-
#initialize(view, position) ⇒ Touch
constructor
A new instance of Touch.
- #inspect ⇒ Object
- #pageX ⇒ Object
- #pageY ⇒ Object
- #viewX ⇒ Object
- #viewY ⇒ Object
Constructor Details
#initialize(view, position) ⇒ Touch
Returns a new instance of Touch.
85 86 87 88 |
# File 'lib/under_os/ui/utils/events.rb', line 85 def initialize(view, position) @view = view @position = position end |
Instance Attribute Details
#position ⇒ Object (readonly)
Returns the value of attribute position.
83 84 85 |
# File 'lib/under_os/ui/utils/events.rb', line 83 def position @position end |
#view ⇒ Object (readonly)
Returns the value of attribute view.
83 84 85 |
# File 'lib/under_os/ui/utils/events.rb', line 83 def view @view end |
Instance Method Details
#inspect ⇒ Object
106 107 108 |
# File 'lib/under_os/ui/utils/events.rb', line 106 def inspect "#<Touch x=#{pageX} y=#{pageY}" end |
#pageX ⇒ Object
90 91 92 |
# File 'lib/under_os/ui/utils/events.rb', line 90 def pageX position.x end |
#pageY ⇒ Object
94 95 96 |
# File 'lib/under_os/ui/utils/events.rb', line 94 def pageY position.y end |
#viewX ⇒ Object
98 99 100 |
# File 'lib/under_os/ui/utils/events.rb', line 98 def viewX @position.x - view._.frame.origin.x end |
#viewY ⇒ Object
102 103 104 |
# File 'lib/under_os/ui/utils/events.rb', line 102 def viewY @position.y - view._.frame.origin.y end |