TooltipLongPressBehavior
Package: Libraries.Interface.Behaviors.Controls · Inherits from: Libraries.Language.Object, Libraries.Interface.Behaviors.Behavior
The TooltipLongPressBehavior class shows tooltips on phones and tablets. A finger held on a control with tooltips turned on shows its tooltip, as a long press does on Android; when the finger lifts, the tooltip stays a moment and then hides. DefaultInputSets:SetupTooltipInput gives one of these to the start of a long press and one, set up with SetEnding(true), to its end.
Example Code
use Libraries.Interface.Behaviors.Controls.TooltipLongPressBehavior
use Libraries.Interface.Events.GestureEvent
use Libraries.Game.InputSet
use Libraries.Game.InputTable
GestureEvent gestures
InputSet longPress
longPress:SetGestureInput(gestures:LONG_PRESS)
longPress:SetInputTrigger(longPress:BEGIN)
TooltipLongPressBehavior behavior
InputTable table
table:SetIdentifier("MyTooltipTouches")
table:Add(longPress, behavior)
Actions
IsEnding()
This action returns whether the behavior is for the end of the long press.
Returns
boolean: true if it is for the end of the long press.
Example
use Libraries.Interface.Behaviors.Controls.TooltipLongPressBehavior
TooltipLongPressBehavior behavior
boolean last = behavior:IsEnding()
IsFinished()
This action returns true: the gesture's work is done at once.
Returns
boolean: true.
Run(Libraries.Interface.Events.BehaviorEvent event)
This action tells the game's TooltipManager about the long press: the item under the finger at its start, or that the finger lifted. The input tables call it, so most users won't need to.
Parameters
eventLibraries.Interface.Events.BehaviorEvent: The gesture event.
SetEnding(boolean value)
This action chooses whether the behavior is for the end of the long press, when the finger lifts, instead of its start.
Parameters
valueboolean: true for the end of the long press.
Example
use Libraries.Interface.Behaviors.Controls.TooltipLongPressBehavior
TooltipLongPressBehavior behavior
behavior:SetEnding(true)