I try to learn Scala the fun way, with a little libgdx project.
Now I'm somewhat stuck:
val go = new TextButton("Go", style)
go.addListener(new ClickListener()
{
override def isPressed() : Boolean =
{
Predef.println("isPressed!)
true
}
}
This doesn't work, sadly. Not sure why. I tried returning a "java.lang.Boolean" but the compiler doesn't allow for that, saying these would be incompatible types.
On the other hand, the "void"-method of keyTyped works like a charm:
textField.setTextFieldListener(new TextFieldListener()
{
override def keyTyped(textField: TextField, key: Char)
{
textFieldInput = textField.getText()
Predef.println(textFieldInput) // TODO remove
}
});
Here when I type something it gets printed to the console.
Any ideas?
That's probably not really related to game-development, still I wasn't sure if another forum would've been a safer bet.