Crafty.translatePointerEventCoordinates()

public Object .translatePointerEventCoordinates(PointerEvent e[, PointerEvent out])
e

Any pointer event with clientX and clientY properties, usually a MouseEvent or Touch object

out

Optional pointer event to augment with coordinates instead

[Returns]

The pointer event, augmented with additional realX and realY 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.