• <option id="kikm0"><source id="kikm0"></source></option>
  • 金沙娱东城官网

    Crafty.findPointerEventTargetByComponent()

    public Object .findPointerEventTargetByComponent(String comp, Number clientX, Number clientY)

    Finds closest entity with certain component at a given position.

    comp

    Component name

    clientX

    x coordinate in client space, usually taken from a pointer event

    clientY

    y coordinate in client space, usually taken from a pointer event

    [Returns]

    The found entity, or null if no entity was found.

    public Object .findPointerEventTargetByComponent(String comp, Event e)

    Finds closest entity with certain component at a given event.

    comp

    Component name

    e

    The pointer event, containing the target and the required properties clientX & clientY, which will be used as the query point

    [Returns]

    The found entity, or null if no entity was found.

    This method is used internally by the .mouseDispatch and .touchDispatch methods, but can be used otherwise for Canvas entities.

    Finds the top most entity (with the highest z) with a given component at a given point (x, y). For having a detection area specified for the enity, add the AreaMap component to the entity expected to be found.

    金沙娱东城官网