Advertisement
xerpi

dd

Apr 22nd, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. private static void Update()
  2.         {
  3.             var gamePadData = GamePad.GetData (0);
  4.             if( FMath.Abs(gamePadData.AnalogRightX) > 0.1 || FMath.Abs(gamePadData.AnalogRightY) > 0.1){ //Deadzone
  5.                 imagebox1.Y += gamePadData.AnalogLeftY * 10;
  6.                 imagebox1.X += gamePadData.AnalogLeftX * 10;
  7.             }
  8.            
  9.             foreach(var touchInfo in Touch.GetData (0))
  10.             {
  11.                 if (touchInfo.Status == TouchStatus.Down || touchInfo.Status == TouchStatus.Move)
  12.                 {
  13.                     imagebox1.Y = (touchInfo.Y + 0.5f) * 544;
  14.                     imagebox1.X = (touchInfo.X + 0.5f) * 960;
  15.                    
  16.                     // Cursor Debugging! :D
  17.                    
  18.                     Console.Write("X");
  19.                     Console.Write((touchInfo.X + 0.5f) * 544);
  20.                     Console.Write("Y");
  21.                     Console.Write((touchInfo.Y + 0.5f) * 544);
  22.                    
  23.                     // END OF CURSOR DEBUGGING
  24.                    
  25.                 }
  26.             }
  27.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement