onClickEvent

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

Attaches a ClickListener to this actor.

Return

ClickListener instance.

Parameters

listener

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


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

Attaches a ClickListener to this actor.

Return

ClickListener instance.

Parameters

listener

invoked each time this actor is clicked. Consumes the triggered InputEvent and the Actor that the listener was originally attached to as this. The received floats are local X and Y coordinates of the actor.