Example #1
0
 public static Point GetPoint(TOUCHINPUT t)
 {
     Point p = new Point();
     p.X = t.x / 100;
     p.Y = t.y / 100;
     return p;
 }
Example #2
0
 public static void OnTouchDown(TOUCHINPUT t)
 {
     int id = t.dwID;
     Point p = GetPoint(t);
     foreach (ControlBase b in MobList)
     {
         if(b.id == -1)
         {
             if (b.check(p))
             {
                 b.id = id;
                 b.draw();
                 return;
             }
         }
     }
 }
Example #3
0
 private static extern bool GetTouchInputInfo(IntPtr HTOUCHINPUT, uint cInputs, ref TOUCHINPUT PTOUCHINPUT, int cbSize);
Example #4
0
        public static void OnTouchUp(TOUCHINPUT t)
        {
            int id = t.dwID;
            Point p = GetPoint(t);

            foreach (ControlBase b in MobList)
            {
                if (b.id == id)
                {
                    b.checkup();
                    b.draw();
                    b.id = -1;
                }
            }
        }
Example #5
0
        public static void OnTouchMove(TOUCHINPUT t)
        {
            int id = t.dwID;
            Point p = GetPoint(t);

            foreach (ControlBase b in MobList)
            {
                if (b.id == id)
                {
                    b.move(p);
                }
            }
        }
Example #6
0
        void MouseDebug()
        {
            base.MouseDown += (new MouseEventHandler((object sender,MouseEventArgs e)=> {
                if (EditStats)
                {
                    EditUI.MouseDown(new Point(e.X, e.Y));
                    return;
                }
                if (!DebugMode) return;
                if (MouseStats) return;
                TOUCHINPUT ti = new TOUCHINPUT();
                ti.x = e.X * 100;
                ti.y = e.Y * 100;
                ti.dwID = 0;
                Touch.OnTouchDown(ti);
                MouseStats = true;
            }));
            base.MouseUp += (new MouseEventHandler((object sender, MouseEventArgs e) => {
                if (EditStats)
                {
                    EditUI.MouseUp();
                    return;
                }
                if (!DebugMode) return;
                if (!MouseStats) return;
                TOUCHINPUT ti = new TOUCHINPUT();
                ti.x = e.X * 100;
                ti.y = e.Y * 100;
                ti.dwID = 0;
                Touch.OnTouchUp(ti);
                MouseStats = false;
            }));

            base.MouseMove += (new MouseEventHandler((object sender, MouseEventArgs e) => {
                if (EditStats)
                {
                    EditUI.MouseMove(new Point(e.X,e.Y));
                    return;
                }
                if (!DebugMode) return;
                if (!MouseStats) return;
                TOUCHINPUT ti = new TOUCHINPUT();
                ti.x = e.X * 100;
                ti.y = e.Y * 100;
                ti.dwID = 0;
                Touch.OnTouchMove(ti);
            }));
        }