I want to implement below example from libgdx wiki in Kotlin
Here is my attempt:
Gdx.input.inputProcessor = InputAdapter() {
override fun touchDown(x: Int, y: Int, pointer: Int, button: Int): Boolean {
// My code
return true
}
}
but I definitely do something wrong
Should be:
Gdx.input.inputProcessor = object : InputAdapter() {
override fun touchDown(x: Int, y: Int, pointer: Int, button: Int): Boolean {
// My code
return true
}
override fun touchUp(x: Int, y: Int, pointer: Int, button: Int): Boolean {
// My code
return true
}
}