Show / Hide Table of Contents

Class Touchscreen

A touchscreen as you know it from smartphones and tablets.

Inheritance
System.Object
InputDevice
Touchscreen
Inherited Members
InputDevice.ButtonPressedLong
InputDevice.LONG_BUTTON_PRESS_THRESHOLD
InputDevice.IsButtonDown(Int32)
InputDevice.ToJson(Boolean)
InputDevice.LoadFromJson(String)
Namespace: GlitchedPolygons.Input
Assembly: UnityScriptsLibrary.dll
Syntax
public class Touchscreen : InputDevice

Methods

| Improve this Doc View Source

GetAxis(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
InputDevice.GetAxis(Int32)
| Improve this Doc View Source

OnDisable()

Declaration
protected override void OnDisable()
Overrides
InputDevice.OnDisable()
| Improve this Doc View Source

OnEnable()

Declaration
protected override void OnEnable()
Overrides
InputDevice.OnEnable()
| Improve this Doc View Source

PressButton(Int32)

Immediately invokes the ButtonPressed event (UI).

Declaration
public void PressButton(int button)
Parameters
Type Name Description
System.Int32 button

The button to press.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

ButtonPressed

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
InputDevice.ButtonPressed
| Improve this Doc View Source

ButtonReleased

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>
Overrides
InputDevice.ButtonReleased
  • Improve this Doc
  • View Source
Back to top Generated by DocFX