onTouchEvent

inline fun <T : Actor> T.onTouchEvent(crossinline onDown: T.(event: InputEvent) -> Unit, crossinline onUp: T.(event: InputEvent) -> Unit): InputListener

Attaches an InputListener to this actor.

Return

InputListener instance.

Parameters

onDown

invoked each time this actor is touched. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this.

onUp

invoked each time the touch of the actor is released. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this.

See also

InputListener.touchDown
InputListener.touchUp

inline fun <T : Actor> T.onTouchEvent(crossinline listener: T.(event: InputEvent) -> Unit): InputListener

Attaches an InputListener to this actor. Retrieve the InputEvent.type to distinguish between touchDown and touchUp events.

Return

InputListener instance.

Parameters

listener

invoked each time this actor is touched or the touch is released. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this.

See also

InputListener.touchDown
InputListener.touchUp

inline fun <T : Actor> T.onTouchEvent(crossinline onDown: T.(event: InputEvent, x: Float, y: Float) -> Unit, crossinline onUp: T.(event: InputEvent, x: Float, y: Float) -> Unit): InputListener

Attaches an InputListener to this actor.

Return

InputListener instance.

Parameters

onDown

invoked each time this actor is touched. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this. Float parameters are local actor coordinates of the event.

onUp

invoked each time the touch of the actor is released. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this. Float parameters are local actor coordinates of the event.

See also

InputListener.touchDown
InputListener.touchUp

inline fun <T : Actor> T.onTouchEvent(crossinline listener: T.(event: InputEvent, x: Float, y: Float) -> Unit): InputListener

Attaches an InputListener to this actor. Retrieve the InputEvent.type to distinguish between touchDown and touchUp events.

Return

InputListener instance.

Parameters

listener

invoked each time this actor is touched or the touch is released. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this. Float parameters are local actor coordinates of the event.

See also

InputListener.touchDown
InputListener.touchUp

inline fun <T : Actor> T.onTouchEvent(crossinline onDown: T.(event: InputEvent, x: Float, y: Float, pointer: Int, button: Int) -> Unit, crossinline onUp: T.(event: InputEvent, x: Float, y: Float, pointer: Int, button: Int) -> Unit): InputListener

Attaches an InputListener to this actor.

Return

InputListener instance.

Parameters

onDown

invoked each time this actor is touched. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this. Refer to InputListener.touchDown parameters documentation.

onUp

invoked each time the touch of the actor is released. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this. Refer to InputListener.touchUp parameters documentation.

See also

InputListener.touchDown
InputListener.touchUp

inline fun <T : Actor> T.onTouchEvent(crossinline listener: T.(event: InputEvent, x: Float, y: Float, pointer: Int, button: Int) -> Unit): InputListener

Attaches a InputListener to this actor. Retrieve the InputEvent.type to distinguish between touchDown and touchUp events.

Return

InputListener instance.

Parameters

listener

invoked each time this actor is touched or the touch is released. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this. Refer to InputListener.touchDown and InputListener.touchUp for parameter details.

See also

InputListener.touchDown
InputListener.touchUp