Click or drag to resize

TouchButton Class

A touch button control.
Inheritance Hierarchy

Namespace:  Rewired.ComponentControls
Assembly:  Rewired_Core (in Rewired_Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
[SerializableAttribute]
public sealed class TouchButton : TouchInteractable

The TouchButton type exposes the following members.

Properties
  NameDescription
Public propertyactivateOnSwipeIn
If true, the button can be turned on by a touch swipe that began in an area outside the button region. If false, the button can only be turned on by a direct press.
Public propertyallowedMouseButtons
The mouse buttons that are allowed to interact with this control.
(Inherited from TouchInteractable.)
Public propertyanimateOnMoveToTouch
Should the button animate when moving to the touch point? This only has an effect if Move To Touch Position is True and a Touch Region is set. This setting is ignored if Follow Touch Position is True.
Public propertyanimateOnReturn
Should the button animate when moving back to its original position? This only has an effect if Follow Touch Position is True, or if Move To Touch Position is True and a Touch Region is set, and Return on Release is True.
Public propertyanimation Obsolete. (Inherited from Component.)
Public propertyanimator
Gets the Animator component on this GameObject. Returns null if no Animator component is found.
(Inherited from TouchInteractable.)
Public propertyaudio Obsolete. (Inherited from Component.)
Public propertybuttonType
The type of button.\nStandard = A momentary switch. Returns True while the button is pressed down.\nToggle Switch = Alternately turns on and off with each press.
Public propertycamera Obsolete. (Inherited from Component.)
Public propertycollider Obsolete. (Inherited from Component.)
Public propertycollider2D Obsolete. (Inherited from Component.)
Public propertyconstantForce Obsolete. (Inherited from Component.)
Public propertydigitalAxisGravity
Speed (units/sec) that the axis value falls toward 0 when not pressed. A value of 1.0 means an axis value of 1 will drain to 0 over 1 second. A value of 3 equates to 1/3 of a second, and so on.
Public propertydigitalAxisSensitivity
Speed to move toward an axis value of 1.0 in units/sec when pressed. A value of 1.0 means an axis value of 0 will reach 1 over 1 second. A value of 3 equates to 1/3 of a second, and so on.
Public propertyenabled (Inherited from Behaviour.)
Public propertyfollowTouchPosition
If True, the button will follow the touch around until released. This setting overrides Move To Touch Position.
Public propertygameObject (Inherited from Component.)
Public propertyguiElement Obsolete. (Inherited from Component.)
Public propertyguiText Obsolete. (Inherited from Component.)
Public propertyguiTexture Obsolete. (Inherited from Component.)
Public propertyhasPointer
Is this button currently being controlled by a touch or pointer?
Public propertyhideFlags (Inherited from Object.)
Public propertyhideWhenIdle
Sets visibility to False when the control is idle. When the control is no longer idle, visibility will be set to True again.
(Inherited from TouchInteractable.)
Public propertyhingeJoint Obsolete. (Inherited from Component.)
Public propertyimage
Gets the Target Graphic as an Image. If the Target Graphic is not an Image, this will return null.
(Inherited from TouchInteractable.)
Public propertyinteractable
Can the control can be interacted with by the user?
(Inherited from TouchInteractable.)
Public propertyinteractionState
The current interaction state.
(Inherited from TouchInteractable.)
Public propertyisActiveAndEnabled (Inherited from Behaviour.)
Public propertylight Obsolete. (Inherited from Component.)
Public propertymanageRaycasting
If True, it will attempt to automatically manage Graphic component raycasting for best results based on your current settings.
Public propertymoveToTouchPosition
If True, the button will move to the location of the current touch in the Touch Region. This can be used to designate an area of the screen as a hot-spot for a button and have the button graphics follow the users touches. This only has an effect if a Touch Region is set.
Public propertymoveToTouchSpeed
The speed at which the button will move toward the touch position measured in screens per second (based on the larger of width and height). [1.0 = Move 1 screen/sec]. This only has an effect if Move To Touch Position is True, Animate On Move To Touch is true, and a Touch Region is set. This setting is ignored if Follow Touch Position is True.
Public propertyname (Inherited from Object.)
Public propertynetworkView Obsolete. (Inherited from Component.)
Public propertyparticleSystem Obsolete. (Inherited from Component.)
Public propertypointerId
The pointer id that currently has control of this button. If there is no pointer id, the value is TouchControl.POINTER_ID_NULL. Only one pointer id (touch, mouse, etc.) may be in control of this button at any time.
Public propertyrenderer Obsolete. (Inherited from Component.)
Public propertyreturnOnRelease
If Move To Touch Position is enabled, this will make the button return to its original position after the press is released. This only has an effect if a Touch Region is set.
Public propertyreturnSpeed
The speed at which the button will move back toward its original position measured in screens per second (based on the larger of width and height). [1.0 = Move 1 screen/sec]. This only has an effect if Follow Touch Position is True, or if Move To Touch Position is True and a Touch Region is set, and Return on Release and Animate on Return are both True.
Public propertyrigidbody Obsolete. (Inherited from Component.)
Public propertyrigidbody2D Obsolete. (Inherited from Component.)
Public propertyrunInEditMode (Inherited from MonoBehaviour.)
Public propertystayActiveOnSwipeOut
If true, the button will stay on even if the touch that activated it moves outside the button region. If false, the button will turn off once the touch that activated it moves outside the button region. If Follow Touch Position is True, this will always return True except in the case of using a Touch Region with Use Touch Region Only set to True also.
Public propertytag (Inherited from Component.)
Public propertytargetCustomControllerElement
The Custom Controller element that will receive input values from this control.
Public propertytargetGraphic
The target Graphic component for interaction state transitions.
(Inherited from TouchInteractable.)
Public propertytouchRegion
Optional external region to use for hover/click/touch detection. If set, this region will be used for touch detection instead of or in addition to the button's RectTransform. This can be useful if you want a larger area of the screen to act as a button.
Public propertytransform (Inherited from Component.)
Public propertytransitionAnimationTriggers
Settings using for Animation Trigger transitions.
(Inherited from TouchInteractable.)
Public propertytransitionColorTint
Settings using for Color Tins transitions.
(Inherited from TouchInteractable.)
Public propertytransitionSpriteState
Settings using for Sprite State transitions.
(Inherited from TouchInteractable.)
Public propertytransitionType
The transition type(s) to be used when transitioning to various states. Multiple transition types can be used simultaneously. Denote multiple transition types using bitwise operations.
(Inherited from TouchInteractable.)
Public propertyuseDigitalAxisSimulation
Makes the axis value gradually change over time based on gravity and sensitivity as the button is pressed.
Public propertyuseGUILayout (Inherited from MonoBehaviour.)
Public propertyuseTouchRegionOnly
If True, hovers/clicks/touches on the local button will be ignored and only Touch Region touches will be used. Otherwise, both touches on the button and on the Touch Region will be used. This also applies to mouse hover. This setting has no effect if no Touch Region is set.
Public propertyvisible
Is the control visible? An invisible control can still be interacted with. This property only has any effect when used with an Image Component.
(Inherited from TouchInteractable.)
Top
Methods
  NameDescription
Public methodBroadcastMessage(String) (Inherited from Component.)
Public methodBroadcastMessage(String, Object) (Inherited from Component.)
Public methodBroadcastMessage(String, SendMessageOptions) (Inherited from Component.)
Public methodBroadcastMessage(String, Object, SendMessageOptions) (Inherited from Component.)
Public methodCancelInvoke (Inherited from MonoBehaviour.)
Public methodCancelInvoke(String) (Inherited from MonoBehaviour.)
Public methodClearValue (Overrides ComponentControlClearValue.)
Public methodCompareTag (Inherited from Component.)
Public methodEquals (Inherited from Object.)
Public methodGetComponent(Type) (Inherited from Component.)
Public methodGetComponent(String) (Inherited from Component.)
Public methodGetComponent``1 (Inherited from Component.)
Public methodGetComponentInChildren(Type) (Inherited from Component.)
Public methodGetComponentInChildren(Type, Boolean) (Inherited from Component.)
Public methodGetComponentInChildren``1 (Inherited from Component.)
Public methodGetComponentInChildren``1(Boolean) (Inherited from Component.)
Public methodGetComponentInParent(Type) (Inherited from Component.)
Public methodGetComponentInParent``1 (Inherited from Component.)
Public methodGetComponents(Type) (Inherited from Component.)
Public methodGetComponents(Type, ListComponent) (Inherited from Component.)
Public methodGetComponents``1 (Inherited from Component.)
Public methodGetComponents``1(ListUMP) (Inherited from Component.)
Public methodGetComponentsInChildren(Type) (Inherited from Component.)
Public methodGetComponentsInChildren(Type, Boolean) (Inherited from Component.)
Public methodGetComponentsInChildren``1 (Inherited from Component.)
Public methodGetComponentsInChildren``1(Boolean) (Inherited from Component.)
Public methodGetComponentsInChildren``1(ListUMP) (Inherited from Component.)
Public methodGetComponentsInChildren``1(Boolean, ListUMP) (Inherited from Component.)
Public methodGetComponentsInParent(Type) (Inherited from Component.)
Public methodGetComponentsInParent(Type, Boolean) (Inherited from Component.)
Public methodGetComponentsInParent``1 (Inherited from Component.)
Public methodGetComponentsInParent``1(Boolean) (Inherited from Component.)
Public methodGetComponentsInParent``1(Boolean, ListUMP) (Inherited from Component.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetInstanceID (Inherited from Object.)
Public methodInvoke (Inherited from MonoBehaviour.)
Public methodInvokeRepeating (Inherited from MonoBehaviour.)
Public methodIsInteractable (Inherited from TouchInteractable.)
Public methodIsInvoking (Inherited from MonoBehaviour.)
Public methodIsInvoking(String) (Inherited from MonoBehaviour.)
Public methodReturnToDefaultPosition
Moves the button to the default position.
Public methodReturnToDefaultPosition(Boolean)
Moves the button to the default position.
Public methodSendMessage(String) (Inherited from Component.)
Public methodSendMessage(String, Object) (Inherited from Component.)
Public methodSendMessage(String, SendMessageOptions) (Inherited from Component.)
Public methodSendMessage(String, Object, SendMessageOptions) (Inherited from Component.)
Public methodSendMessageUpwards(String) (Inherited from Component.)
Public methodSendMessageUpwards(String, Object) (Inherited from Component.)
Public methodSendMessageUpwards(String, SendMessageOptions) (Inherited from Component.)
Public methodSendMessageUpwards(String, Object, SendMessageOptions) (Inherited from Component.)
Public methodSetDefaultPosition
Record the current anchored position as the button's default position. The button will return to this position when released when using a Touch Region with moveToTouchPosition set to True. If you move the button's position and want it to return there next time, you should record the new default position by calling this method.
Public methodSetRawValue
Set the raw value in the button's axis.
Public methodStartCoroutine(String) (Inherited from MonoBehaviour.)
Public methodStartCoroutine(IEnumerator) (Inherited from MonoBehaviour.)
Public methodStartCoroutine(String, Object) (Inherited from MonoBehaviour.)
Public methodStartCoroutine_Auto Obsolete. (Inherited from MonoBehaviour.)
Public methodStopAllCoroutines (Inherited from MonoBehaviour.)
Public methodStopCoroutine(IEnumerator) (Inherited from MonoBehaviour.)
Public methodStopCoroutine(Coroutine) (Inherited from MonoBehaviour.)
Public methodStopCoroutine(String) (Inherited from MonoBehaviour.)
Public methodToString (Inherited from Object.)
Top
Events
  NameDescription
Public eventAxisValueChangedEvent
Event sent when the axis value changes.
Public eventButtonDownEvent
Event sent when the button is pressed.
Public eventButtonUpEvent
Event sent when the button is released
Public eventButtonValueChangedEvent
Event sent when the button value changes.
Public eventInteractionStateChangedToDisabled
Event sent when interaction state changes to Disabled.
(Inherited from TouchInteractable.)
Public eventInteractionStateChangedToHighlighted
Event sent when interaction state changes to Highlighted.
(Inherited from TouchInteractable.)
Public eventInteractionStateChangedToNormal
Event sent when interaction state changes to Normal.
(Inherited from TouchInteractable.)
Public eventInteractionStateChangedToPressed
Event sent when interaction state changes to Pressed.
(Inherited from TouchInteractable.)
Public eventInteractionStateSetEvent
Event sent when the Interaction State changes.
(Inherited from TouchInteractable.)
Public eventVisibilityChangedEvent
Event sent when visibility changes.
(Inherited from TouchInteractable.)
Top
See Also