Class: UnderOs::UI::Events::Event
- Inherits:
-
Events::Event
- Object
- Events::Event
- UnderOs::UI::Events::Event
- Defined in:
- lib/under_os/ui/utils/events.rb
Constant Summary collapse
- RECOGNIZER_STATES =
{ UIGestureRecognizerStateBegan => :began, UIGestureRecognizerStateChanged => :changed, UIGestureRecognizerStateEnded => :ended, UIGestureRecognizerStateCancelled => :canceled, UIGestureRecognizerStateFailed => :failed }.freeze
Instance Attribute Summary collapse
-
#_ ⇒ Object
readonly
Returns the value of attribute _.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #angle ⇒ Object
- #angle=(value) ⇒ Object
-
#initialize(original, target, event, params = {}) ⇒ Event
constructor
A new instance of Event.
- #scale ⇒ Object
- #scale=(value) ⇒ Object
- #state ⇒ Object
- #translation(view) ⇒ Object
- #translation=(params) ⇒ Object
Constructor Details
#initialize(original, target, event, params = {}) ⇒ Event
Returns a new instance of Event.
164 165 166 167 168 169 |
# File 'lib/under_os/ui/utils/events.rb', line 164 def initialize(original, target, event, params={}) @_ = original @target = target super event, params end |
Instance Attribute Details
#_ ⇒ Object (readonly)
Returns the value of attribute _.
162 163 164 |
# File 'lib/under_os/ui/utils/events.rb', line 162 def _ @_ end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
162 163 164 |
# File 'lib/under_os/ui/utils/events.rb', line 162 def target @target end |
Instance Method Details
#angle ⇒ Object
179 180 181 |
# File 'lib/under_os/ui/utils/events.rb', line 179 def angle @_.rotation end |
#angle=(value) ⇒ Object
183 184 185 |
# File 'lib/under_os/ui/utils/events.rb', line 183 def angle=(value) @_.rotation = value end |
#scale ⇒ Object
171 172 173 |
# File 'lib/under_os/ui/utils/events.rb', line 171 def scale @_.scale end |
#scale=(value) ⇒ Object
175 176 177 |
# File 'lib/under_os/ui/utils/events.rb', line 175 def scale=(value) @_.scale = value end |
#state ⇒ Object
206 207 208 |
# File 'lib/under_os/ui/utils/events.rb', line 206 def state RECOGNIZER_STATES[@_.state] end |
#translation(view) ⇒ Object
187 188 189 190 |
# File 'lib/under_os/ui/utils/events.rb', line 187 def translation(view) view = view._ if view.is_a?(UnderOs::UI::View) @_.translationInView(view) end |
#translation=(params) ⇒ Object
192 193 194 195 196 |
# File 'lib/under_os/ui/utils/events.rb', line 192 def translation=(params) point = params[0]; view = params[1] view = view._ if view.is_a?(UnderOs::UI::View) @_.setTranslation(point, inView:view) end |