C# Class WaveEngine.Components.Gestures.TouchGestures

Inheritance: Behavior, ITouchable
Exibir arquivo Open project: WaveEngine/Components Class Usage Examples

Private Properties

Property Type Description
ComputeCentroid System.Vector2
DrawOrderPropertyChanged void
FindTwoFarthestTouches void
FreeState void
InvokeEvent void
IsGestureSupported bool
IsMoving bool
IsMovingOverThreshold bool
NoneState void
PressedState void
StoppedAndDragState void
TapState void
UpdatePreviousValues void

Public Methods

Method Description
AddTouch ( TouchLocation touch, bool isNew ) : void

Adds a TouchLocation to the current active touches.

Contains ( System.Vector2 point ) : bool

Determines whether the required Collider2D contains the passed point.

ReadGesture ( ) : GestureSample

Gets the current GestureSample.

TouchGestures ( ) : System

Initializes a new instance of the TouchGestures class.

TouchGestures ( bool projectCamera = true ) : System

Initializes a new instance of the TouchGestures class. By default, scale is within [0.1, 5], the delta scale is set to 1 and there is no supported gesture.

UpdateTouchOrder ( ) : void

If and only if ManualTouchOrder is set to false (by default it is) the touch order is calculated based on both and the Layer used.

Protected Methods

Method Description
DefaultValues ( ) : void

This methods is used to set default values by the default constructor of our classes. This is called too when an entity is deserializing.

DeleteDependencies ( ) : void

Delete dependencies method

ResolveDependencies ( ) : void

Resolves the dependencies needed for this instance to work.

Update ( System.TimeSpan gameTime ) : void

Updates this behavior.

Private Methods

Method Description
ComputeCentroid ( List touches ) : System.Vector2

Computes the centroid of a group of touches.

DrawOrderPropertyChanged ( object sender, DependencyPropertyChangedEventArgs &e ) : void

Draws the order property changed.

FindTwoFarthestTouches ( List touches, System.Vector2 &point1, System.Vector2 &point2 ) : void

Finds the two farthest touches in a group of touches.

FreeState ( ) : void

Handle the FreeState

InvokeEvent ( EventHandler touchEvent, GestureSample sample ) : void

Invokes the event.

IsGestureSupported ( SupportedGesture type ) : bool

Determines whether a type of gesture is supported.

IsMoving ( ) : bool

Determines whether this instance is moving.

IsMovingOverThreshold ( ) : bool

Determines whether [is moving over threshold].

NoneState ( ) : void

Handle the NoneState

PressedState ( ) : void

Handle the PressedState

StoppedAndDragState ( ) : void

Handle the StoppedAndDragState

TapState ( ) : void

Handle the TapState

UpdatePreviousValues ( ) : void

Updates the previous values.

Method Details

AddTouch() public method

Adds a TouchLocation to the current active touches.
public AddTouch ( TouchLocation touch, bool isNew ) : void
touch TouchLocation The touch location.
isNew bool Whether such touch must be considered as new.
return void

Contains() public method

Determines whether the required Collider2D contains the passed point.
public Contains ( System.Vector2 point ) : bool
point System.Vector2 The point.
return bool

DefaultValues() protected method

This methods is used to set default values by the default constructor of our classes. This is called too when an entity is deserializing.
protected DefaultValues ( ) : void
return void

DeleteDependencies() protected method

Delete dependencies method
protected DeleteDependencies ( ) : void
return void

ReadGesture() public method

Gets the current GestureSample.
public ReadGesture ( ) : GestureSample
return GestureSample

ResolveDependencies() protected method

Resolves the dependencies needed for this instance to work.
protected ResolveDependencies ( ) : void
return void

TouchGestures() public method

Initializes a new instance of the TouchGestures class.
public TouchGestures ( ) : System
return System

TouchGestures() public method

Initializes a new instance of the TouchGestures class. By default, scale is within [0.1, 5], the delta scale is set to 1 and there is no supported gesture.
public TouchGestures ( bool projectCamera = true ) : System
projectCamera bool Indicates if the touches will be processed using Cameras
return System

Update() protected method

Updates this behavior.
protected Update ( System.TimeSpan gameTime ) : void
gameTime System.TimeSpan The elapsed game time.
return void

UpdateTouchOrder() public method

If and only if ManualTouchOrder is set to false (by default it is) the touch order is calculated based on both and the Layer used.
public UpdateTouchOrder ( ) : void
return void