5
\$\begingroup\$

I mean, I've been searching it, they always use set a stage as an input processor after they had added the Touchpadto the Stage because it extends from Actor indireclty(it extends from Widget that extends from Actor), just like this:

myStage.addActor(myTouchpad);
Gdx.input.setInputProcessor(myStage);

Is there any other way to set the input processor when creating a touchpad?

\$\endgroup\$
  • 1
    \$\begingroup\$ Can I ask why you do not wish to use a stage? If it's because you need to use another InputProcessor you can use their InputMultiplexer to combine two (or more) InputProcessors. \$\endgroup\$ – Charanor Jul 9 '16 at 18:18
0
\$\begingroup\$

You can also create a class that extends InputProcessor.

Then add add it as the Gdx InputProcessor.

Gdx.input.setInputProcessor(MyInputProcessor);

More information on the LibGDX wiki: Event handling.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ But then the joystick wouldn't work, would it? \$\endgroup\$ – Asaltaviejas Jan 11 '16 at 2:22
  • \$\begingroup\$ Make it so that it also extends ControllerListener. \$\endgroup\$ – Mayuso Jan 11 '16 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.