/// <summary> /// This methods is used to set default values by the default constructor of our classes. /// This is called too when an entity is deserializing. /// </summary> protected override void DefaultValues() { base.DefaultValues(); this.currentTouches = new List<TouchLocation>(); this.minScale = 0.1f; this.maxScale = 5f; this.gestureSample = new GestureSample { DeltaScale = 1 }; this.enabledGestures = SupportedGesture.None; this.ProjectCamera = true; }
/// <summary> /// Initializes a new instance of the <see cref="TouchGestures"/> class. /// By default, scale is within [0.1, 5], the delta scale is set to 1 and there is no /// supported gesture. /// </summary> /// <param name="projectCamera">Indicates if the touches will be processed using Cameras</param> public TouchGestures(bool projectCamera = true) : base("TouchGestures" + instances++) { this.currentTouches = new List <TouchLocation>(); this.minScale = 0.1f; this.maxScale = 5f; this.gestureSample = new GestureSample { DeltaScale = 1 }; this.enabledGestures = SupportedGesture.None; this.projectCamera = projectCamera; }
void rightHandGestureRecognizer_OnGestureDetected(SupportedGesture gesture) { switch (gesture) { case SupportedGesture.SwipeToLeft: Gesture.Content = "GestureDetected:SwipeToLeft"; break; case SupportedGesture.SwipeToRight: Gesture.Content = "GestureDetected:SwipeToRight"; break; } }
/// <summary> /// Determines whether a type of gesture is supported. /// </summary> /// <param name="type">The type.</param> /// <returns> /// <c>true</c> if the type of gesture is supported; otherwise, <c>false</c>. /// </returns> private bool IsGestureSupported(SupportedGesture type) { return((this.enabledGestures & type) == type); }
/// <summary> /// Determines whether a type of gesture is supported. /// </summary> /// <param name="type">The type.</param> /// <returns> /// <c>true</c> if the type of gesture is supported; otherwise, <c>false</c>. /// </returns> private bool IsGestureSupported(SupportedGesture type) { return (this.enabledGestures & type) == type; }
/// <summary> /// Initializes a new instance of the <see cref="TouchGestures"/> class. /// By default, scale is within [0.1, 5], the delta scale is set to 1 and there is no /// supported gesture. /// </summary> /// <param name="projectCamera">Indicates if the touches will be processed using Cameras</param> public TouchGestures(bool projectCamera = true) : base("TouchGestures" + instances++) { this.currentTouches = new List<TouchLocation>(); this.minScale = 0.1f; this.maxScale = 5f; this.gestureSample = new GestureSample { DeltaScale = 1 }; this.enabledGestures = SupportedGesture.None; this.projectCamera = projectCamera; }