The Touch
interface represents a single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad.
The Touch.radiusX
, Touch.radiusY
, and Touch.rotationAngle
describe the area of contact between the user and the screen, the touch area. This can be helpful when dealing with imprecise pointing devices such as fingers. These values are set to describe an ellipse that as closely as possible matches the entire area of contact (such as the user's fingertip). Experimental
Note: Many of the properties' values are hardware-dependent; for example, if the device doesn't have a way to detect the amount of pressure placed on the surface, the force
value will always be 0. This may also be the case for radiusX
and radiusY
; if the hardware reports only a single point, these values will be 1.
This interface has no parent, and doesn't inherit or implement other properties.
-
Touch.radiusX
Read only
Experimental
-
Returns the X radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenX
.
-
Touch.radiusY
Read only
Experimental
-
Returns the Y radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenY
.
-
Touch.rotationAngle
Read only
Experimental
-
Returns the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface.
-
Touch.force
Read only
Experimental
-
Returns the amount of pressure being applied to the surface by the user, as a float
between 0.0
(no pressure) and 1.0
(maximum pressure).
This interface has no methods and no parent, and doesn't inherit or implement any methods.