/// <summary>Releases the touch with the specified id</summary>
 /// <param name="id">Id of the touch that will be released</param>
 public void Release(int id)
 {
     TouchCollectionHelper.AddTouchLocation(
         ref this.touchCollection,
         id,
         TouchLocationState.Released,
         -1.0f,
         -1.0f,
         TouchLocationState.Invalid,
         -1.0f,
         -1.0f
         );
 }
 /// <summary>Moves an existing touch to a different location</summary>
 /// <param name="id">Id of the touch that will be moved</param>
 /// <param name="x">New X coordinate the touch moved to</param>
 /// <param name="y">New Y coordinate the touch moved to</param>
 public void Move(int id, float x, float y)
 {
     TouchCollectionHelper.AddTouchLocation(
         ref this.touchCollection,
         id,
         TouchLocationState.Moved,
         x,
         y,
         TouchLocationState.Invalid,
         -1.0f,
         -1.0f
         );
 }
示例#3
0
        public void TestAddTouchLocation()
        {
            var touches = new TouchCollection();

            TouchCollectionHelper.AddTouchLocation(
                ref touches, 1,
                TouchLocationState.Pressed, 12, 34,
                TouchLocationState.Released, 56, 78
                );

            Assert.AreEqual(1, touches.Count);

            TouchLocation location = touches[0];

            Assert.AreEqual(12, location.Position.X);
            Assert.AreEqual(34, location.Position.Y);
            Assert.AreEqual(TouchLocationState.Pressed, location.State);
            Assert.AreEqual(1, location.Id);
        }