Advertisement
acegiak

controllerhandler

Oct 14th, 2014
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. @Override
  2.     public boolean axisMoved(Controller arg0, int arg1, float arg2) {
  3.        
  4.         if(arg2 < this.JOY_TRIGGER_SENSITIVITY*-1){
  5.             MenuUp();
  6.         }else if(arg2 > this.JOY_TRIGGER_SENSITIVITY){
  7.             MenuDown();
  8.         }
  9.         return false;
  10.     }
  11.  
  12.     @Override
  13.     public boolean povMoved(Controller arg0, int arg1, PovDirection arg2) {
  14.        
  15.  
  16.         if(arg2 == PovDirection.north || arg2 == PovDirection.west || arg2 == PovDirection.northWest){
  17.             MenuUp();
  18.         }
  19.         if(arg2 == PovDirection.south || arg2 == PovDirection.east || arg2 == PovDirection.southEast){
  20.             MenuDown();
  21.         }
  22.         return false;
  23.     }
  24.     private void MenuCancel() {
  25.         if(Amygdala.current().getScreen() instanceof ButtonMenu){
  26.             ((ButtonMenu)Amygdala.current().getScreen()).MenuCancel();
  27.         }      
  28.     }
  29.  
  30.     private void MenuOk() {
  31.  
  32.         if(Amygdala.current().getScreen() instanceof ButtonMenu){
  33.             ((ButtonMenu)Amygdala.current().getScreen()).MenuOk();
  34.         }      
  35.        
  36.     }
  37.  
  38.     private void MenuDown() {
  39.  
  40.         if(Amygdala.current().getScreen() instanceof ButtonMenu){
  41.             ((ButtonMenu)Amygdala.current().getScreen()).MenuDown();
  42.         }      
  43.        
  44.     }
  45.  
  46.     private void MenuUp() {
  47.  
  48.         if(Amygdala.current().getScreen() instanceof ButtonMenu){
  49.             ((ButtonMenu)Amygdala.current().getScreen()).MenuUp();
  50.         }      
  51.        
  52.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement