Class Touchscreen
A touchscreen as you know it from smartphones and tablets.
Inherited Members
Namespace: GlitchedPolygons.Input
Assembly: UnityScriptsLibrary.dll
Syntax
public class Touchscreen : InputDevice
Methods
| Improve this Doc View SourceGetAxis(Int32)
Gets the current value of a game axis.
Declaration
public override float GetAxis(int axisIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | The axis to query (its integer index). |
Returns
| Type | Description |
|---|---|
| System.Single | The current value of the game axis (usually this number is [-1;1] ) |
Overrides
| Improve this Doc View SourceOnDisable()
Declaration
protected override void OnDisable()
Overrides
| Improve this Doc View SourceOnEnable()
Declaration
protected override void OnEnable()
Overrides
| Improve this Doc View SourcePressButton(Int32)
Immediately invokes the ButtonPressed event (UI).
Declaration
public void PressButton(int button)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | button | The button to press. |
ReleaseButton(Int32)
Immediately invokes the ButtonReleased event (UI).
Declaration
public void ReleaseButton(int button)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | button | The button that's been released. |
SetAxis(Int32, Single)
Sets an axis value directly.
WARNING: This is not clamped! You have to clamp the axis value manually if you want range restrictions!
Declaration
public void SetAxis(int axisIndex, float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | Axis to set. |
| System.Single | value | The value. |
SetAxis(Int32, Single, Vector2)
Sets an axis value directly after being clamped between clampRange.x and clampRange.y
Declaration
public void SetAxis(int axisIndex, float value, Vector2 clampRange)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | axisIndex | Axis to set. |
| System.Single | value | The value. |
| Vector2 | clampRange | The allowed value range (e.g. [-1;1] ) |
Events
| Improve this Doc View SourceButtonPressed
This event is raised in the frame where the player presses a button.
Which button was pressed is passed as int argument.
Declaration
public override event Action<int> ButtonPressed
Event Type
| Type | Description |
|---|---|
| System.Action<System.Int32> |
Overrides
| Improve this Doc View SourceButtonReleased
This event is invoked the frame when the user lets go of a button.
Which button was released is passed as int argument.
Declaration
public override event Action<int> ButtonReleased
Event Type
| Type | Description |
|---|---|
| System.Action<System.Int32> |