2 using System.Collections.Generic;
7 using Microsoft.Xna.Framework.Input.Touch;
8 using Microsoft.Xna.Framework;
26 internal List<GestureSample> samples =
new List<GestureSample>();
31 ActiveTouches =
new List<Touch>( 5 );
32 ActiveGestures =
new List<Gesture>( 5 );
35 internal Touch GetObjectByChannel(
int channel )
39 int touches = ActiveTouches.Count;
41 if ( channel >= touches )
44 return ActiveGestures[channel - touches];
48 return ActiveTouches[channel];
54 ActiveTouches =
new List<Touch>();
55 ActiveGestures =
new List<Gesture>( 5 );
56 this.samples = samples;
58 for (
int i = 0; i < touchCollection.Count; i++ )
60 GetTouchObject( touchCollection[i], prevState );
63 for (
int i = 0; i < samples.Count; i++ )
65 GetGestureObject( samples[i] );
69 private Touch GetGestureObject( GestureSample gestureSample )
71 Gesture gesture =
new Gesture( gestureSample.Position, gestureSample.Delta, gestureSample.Position2, gestureSample.Delta2 );
72 ActiveGestures.Add( gesture );
85 touch.Update( location.Position, location.State );
87 ActiveTouches.Add( touch );
92 touch =
new Touch( location.Id, location.Position, location.State );
93 ActiveTouches.Add( touch );
List< Gesture > ActiveGestures
Aktiiviset eleet ruudulla
Kosketuspaneelin kosketus.
List< Touch > ActiveTouches
Aktiiviset kosketukset ruudulla