Struct TouchPanelState
Represents the state of the touch panel.
Implements
Namespace: Evergine.Common.Input
Assembly: Evergine.Common.dll
Syntax
public struct TouchPanelState : IController
Constructors
TouchPanelState(TouchLocation[])
Initializes a new instance of the TouchPanelState struct.
Declaration
public TouchPanelState(TouchLocation[] touches)
Parameters
Type | Name | Description |
---|---|---|
TouchLocation[] | touches | The touch points. |
Fields
MaxTouches
Maximum number of touches.
Declaration
public const int MaxTouches = 16
Field Value
Type | Description |
---|---|
int |
Properties
Count
Gets the count.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsConnected
Gets or sets a value indicating whether this instance is connected.
Declaration
public bool IsConnected { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
IsReadOnly
Gets a value indicating whether this instance is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
|
this[int]
Gets or sets the TouchLocation at the specified index.
Declaration
public TouchLocation this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | index | The touch index. |
Property Value
Type | Description |
---|---|
TouchLocation | The result. |
Methods
AddTouchLocation(int, TouchLocationState, float, float)
Adds the touch location.
Declaration
[Obsolete("Use AddTouchLocation(int id, float x, float y) instead")]
public void AddTouchLocation(int id, TouchLocationState state, float x, float y)
Parameters
Type | Name | Description |
---|---|---|
int | id | The ID. |
TouchLocationState | state | The touch state. |
float | x | The X coordinate. |
float | y | The Y coordinate. |
AddTouchLocation(int, float, float)
Adds the touch location.
Declaration
public void AddTouchLocation(int id, float x, float y)
Parameters
Type | Name | Description |
---|---|---|
int | id | The ID. |
float | x | The X coordinate. |
float | y | The Y coordinate. |
Clear()
Clears the instance.
Declaration
public void Clear()
Contains(TouchLocation)
Determines whether the specified item is contained.
Declaration
public bool Contains(TouchLocation item)
Parameters
Type | Name | Description |
---|---|---|
TouchLocation | item | The item. |
Returns
Type | Description |
---|---|
bool |
|
Contains(int)
Determines whether [the specified id] is contained.
Declaration
public bool Contains(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | The id. |
Returns
Type | Description |
---|---|
bool |
|
CopyTo(TouchLocation[], int)
Copies to the specified array.
Declaration
public void CopyTo(TouchLocation[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
TouchLocation[] | array | The target array. |
int | arrayIndex | The index in the array where the copying starts. |
GetEnumerator()
Gets the enumerator.
Declaration
public TouchPanelState.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
TouchPanelState.Enumerator | The result. |
IndexOf(TouchLocation)
Indexes the object.
Declaration
public int IndexOf(TouchLocation touch)
Parameters
Type | Name | Description |
---|---|---|
TouchLocation | touch | The touch object. |
Returns
Type | Description |
---|---|
int | The result. |
ModifyTouch(int, TouchLocationState, float, float)
Modifies the touch event.
Declaration
public void ModifyTouch(int id, TouchLocationState newState, float newX, float newY)
Parameters
Type | Name | Description |
---|---|---|
int | id | The ID. |
TouchLocationState | newState | The new state. |
float | newX | The new X coordinate. |
float | newY | The new Y coordinate. |
RemoveTouchLocation(int)
Adds the touch location.
Declaration
public void RemoveTouchLocation(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | The ID. |
TryGetTouch(int, out TouchLocation)
Tries to get touch data.
Declaration
public bool TryGetTouch(int id, out TouchLocation touchLocation)
Parameters
Type | Name | Description |
---|---|---|
int | id | The ID. |
TouchLocation | touchLocation | The touch location. |
Returns
Type | Description |
---|---|
bool | The result. |
Update()
Clears this instance.
Declaration
public void Update()