Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.badlogic.gdx.InputProcessor;
- public class UIInputProcessor implements InputProcessor{
- @Override
- public boolean touchDragged(int screenX, int screenY, int pointer) {
- if(screenX >= 50 && screenX <= 100
- && screenY >= 50 && screenY <= 150 ){
- // I assume the sreen UI window is 50px x 100px with its lower left corner at 50,50
- //TODO respond to UI events
- return true; // this event has been processed so respond true so events do not get passed to next input processor
- }
- return false;
- }
- //.. some events removed for clarity
- }
- import com.badlogic.gdx.InputProcessor;
- public class MainInputProcessor implements InputProcessor{
- @Override
- public boolean keyDown(int keycode) {
- // input events for main area
- return false;
- }
- //.. some events removed for clarity
- @Override
- public boolean scrolled(int amount) {
- // input events for main area
- return false;
- }
- }
- MyProcessor = new InputMultiplexer(new UIInputMuliplexer(), new MainInputProcessor());
- MyProcessor = new InputMultiplexer(MyStage, new MainInputProcessor());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement