Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. import com.badlogic.gdx.InputProcessor;
  2.  
  3.  
  4. public class UIInputProcessor implements InputProcessor{
  5.  
  6.  
  7.  
  8. @Override
  9. public boolean touchDragged(int screenX, int screenY, int pointer) {
  10. if(screenX >= 50 && screenX <= 100
  11. && screenY >= 50 && screenY <= 150 ){
  12. // I assume the sreen UI window is 50px x 100px with its lower left corner at 50,50
  13.  
  14. //TODO respond to UI events
  15.  
  16. return true; // this event has been processed so respond true so events do not get passed to next input processor
  17. }
  18.  
  19. return false;
  20. }
  21.  
  22. //.. some events removed for clarity
  23.  
  24. }
  25.  
  26. import com.badlogic.gdx.InputProcessor;
  27.  
  28.  
  29. public class MainInputProcessor implements InputProcessor{
  30.  
  31. @Override
  32. public boolean keyDown(int keycode) {
  33. // input events for main area
  34. return false;
  35. }
  36.  
  37. //.. some events removed for clarity
  38.  
  39. @Override
  40. public boolean scrolled(int amount) {
  41. // input events for main area
  42. return false;
  43. }
  44.  
  45. }
  46.  
  47. MyProcessor = new InputMultiplexer(new UIInputMuliplexer(), new MainInputProcessor());
  48.  
  49. MyProcessor = new InputMultiplexer(MyStage, new MainInputProcessor());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement