Пример #1
0
 private static void OnJoystickAxisMove(object sender, SdlDotNet.Input.JoystickAxisEventArgs e)
 {
     if (PausedShowMenu)
     {
         Rooms[RoomIndex].DoJoystickAxisMove(e);
         return;
     }
     CheckJoyShortcuts();
 }
Пример #2
0
        public override void DoJoystickAxisMove(JoystickAxisEventArgs e)
        {
            //Console.WriteLine(joystick.GetAxisPosition(JoystickAxis.Horizontal).ToString());
            if (!lockKeysJoystick)
                base.DoJoystickAxisMove(e);
            else
            {
                lockKeysJoystick = false;

                Items[SelectedMenuIndex].Options.Clear();
                if (e.AxisIndex == 0)
                    Items[SelectedMenuIndex].Options.Add((e.AxisValue > 0) ? "+X" : "-X");
                else
                    Items[SelectedMenuIndex].Options.Add((e.AxisValue > 0) ? "+Y" : "-Y");
            }
        }
Пример #3
0
 /// <summary>
 /// Processes a joystick motion event. This event is triggered by
 /// SDL. Only
 /// sprites that are JoystickSensitive are processed.
 /// </summary>
 /// <param name="args">Event args</param>
 public virtual void Update(JoystickAxisEventArgs args)
 {
 }
Пример #4
0
 private void JoystickAxisChanged(object sender, JoystickAxisEventArgs e)
 {
     if (e.AxisIndex == 0)
     {
         position.X = (int)(joystick.GetAxisPosition(JoystickAxis.Horizontal) * width);
     }
     else if (e.AxisIndex == 1)
     {
         position.Y = (int)(joystick.GetAxisPosition(JoystickAxis.Vertical) * height);
     }
 }
Пример #5
0
 static void OnJoystickAxisMotion(JoystickAxisEventArgs e)
 {
     if (JoystickAxisMotion != null)
     {
         if (((e.RawAxisValue < (-1) * JoystickAxisEventArgs.JoystickThreshold) ||
             (e.RawAxisValue > JoystickAxisEventArgs.JoystickThreshold)) && (e.AxisIndex == 0 || e.AxisIndex == 1))
         {
             JoystickAxisMotion(instance, e);
         }
     }
 }