class DXOpal::Input::Touch
Represents a touch
Attributes
_released_at[R]
data[R]
id[R]
x[R]
y[R]
Public Class Methods
new(id, x, y)
click to toggle source
# File lib/dxopal/input.rb, line 275 def initialize(id, x, y) @id = id _move(x, y) @_released_at = nil @data = {} end
Public Instance Methods
_move(x, y)
click to toggle source
# File lib/dxopal/input.rb, line 293 def _move(x, y) @x = x @y = y end
_released(tick)
click to toggle source
# File lib/dxopal/input.rb, line 298 def _released(tick) @_released_at = tick end
inspect()
click to toggle source
# File lib/dxopal/input.rb, line 288 def inspect rel = (released_at ? " released_at=#{released_at}" : "") "#<DXOpal::Touch id=#{id} x=#{x} y=#{y} data=#{data.inspect}#{rel}>" end
released?()
click to toggle source
Return true if this touch is released in the last tick
# File lib/dxopal/input.rb, line 284 def released? !!@_released_at end