Function getPointerEventNormPos

  • Extracts the position of a DOM MouseEvent and normalises it. Useful for implementing mouse input.

    Parameters

    • event: MouseEvent
    • domElem: HTMLElement

    Returns [number, number]

    Returns a 2-tuple containing the normalised coordinates; the first element contains the normalised x axis, and the second element contains the normalised y axis