Crafty.translatePointerEventCoordinates()
public Object .translatePointerEventCoordinates(PointerEvent e[, PointerEvent out])
- e
Any pointer event with
clientX
andclientY
properties, usually aMouseEvent
orTouch
object
- out
Optional pointer event to augment with coordinates instead
- [Returns]
The pointer event, augmented with additional
realX
andrealY
properties
Updates the passed event object to have two additional properties, realX
and realY
,
which correspond to the point in actual world space the event happened.
This method is used internally by the .mouseDispatch and .touchDispatch methods, but may be used for custom events.