已答覆 Touchstate problem

  • 2012年3月5日 下午 04:27
     
      包含代碼

    ich habe die Folgene Methode

    public static bool fired;        
    
            public static bool FireButtonTouch(this TouchCollection touchState)
            {
    
                foreach (TouchLocation location in touchState)
                {
                    // Right side of the screen
                    if (((location.Position.X > 400) && (location.Position.Y > 0)) &&
                        ((location.Position.X < 800) && (location.Position.Y < 480)) &&
                        (location.State == TouchLocationState.Pressed))
                    {                   
                        return fired = true;
                    }
                }
                return fired = false;
            }

    diese reagiert kurz gesagt wenn die rechte seite des Bildschirms (landscape)  berühert wird.

    Das problem ist ich bin darauf angewiesen, dass ich nach TouchLocationState.Pressed frage und nicht nach TouchLocationState.moved.

    Nun reagiert aber das Spiel immer nur auf moved, bzw das ergebnis ist iommer ein zustand moved. WIe kann ich das verhindern ?

所有回覆