Class TooltipManager
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.ui.TooltipManager
-
public class TooltipManager extends java.lang.ObjectKeeps track of an application's tooltips.
-
-
Field Summary
Fields Modifier and Type Field Description booleananimationsIf false, tooltips will be shown without animations.floatedgeDistanceThe distance from the tooltip actor position to the edge of the screen where the actor will be shown on the other side of the mouse cursor.booleanenabledIf false, tooltips will not be shown.floatinitialTimeSeconds from when an actor is hovered to when the tooltip is shown.floatmaxWidthThe maximum width of aTextTooltip.floatoffsetXThe distance from the mouse position to offset the tooltip actor.floatoffsetYThe distance from the mouse position to offset the tooltip actor.floatresetTimeSeconds to usesubsequentTime.floatsubsequentTimeOnce a tooltip is shown, this is used instead ofinitialTime.
-
Constructor Summary
Constructors Constructor Description TooltipManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenter(Tooltip tooltip)static TooltipManagergetInstance()voidhide(Tooltip tooltip)protected voidhideAction(Tooltip tooltip)Called when tooltip is hidden.voidhideAll()voidinstant()Shows all tooltips on hover without a delay forresetTimeseconds.protected voidshowAction(Tooltip tooltip)Called when tooltip is shown.voidtouchDown(Tooltip tooltip)
-
-
-
Field Detail
-
initialTime
public float initialTime
Seconds from when an actor is hovered to when the tooltip is shown. Default is 2. CallhideAll()after changing to reset internal state.
-
subsequentTime
public float subsequentTime
Once a tooltip is shown, this is used instead ofinitialTime. Default is 0.
-
resetTime
public float resetTime
Seconds to usesubsequentTime. Default is 1.5.
-
enabled
public boolean enabled
If false, tooltips will not be shown. Default is true.
-
animations
public boolean animations
If false, tooltips will be shown without animations. Default is true.
-
maxWidth
public float maxWidth
The maximum width of aTextTooltip. The label will wrap if needed. Default is Integer.MAX_VALUE.
-
offsetX
public float offsetX
The distance from the mouse position to offset the tooltip actor. Default is 15,19.
-
offsetY
public float offsetY
The distance from the mouse position to offset the tooltip actor. Default is 15,19.
-
edgeDistance
public float edgeDistance
The distance from the tooltip actor position to the edge of the screen where the actor will be shown on the other side of the mouse cursor. Default is 7.
-
-
Method Detail
-
touchDown
public void touchDown(Tooltip tooltip)
-
enter
public void enter(Tooltip tooltip)
-
hide
public void hide(Tooltip tooltip)
-
showAction
protected void showAction(Tooltip tooltip)
Called when tooltip is shown. Default implementation sets actions to animate showing.
-
hideAction
protected void hideAction(Tooltip tooltip)
Called when tooltip is hidden. Default implementation sets actions to animate hiding and to remove the actor from the stage when the actions are complete. A subclass must at least remove the actor.
-
hideAll
public void hideAll()
-
instant
public void instant()
Shows all tooltips on hover without a delay forresetTimeseconds.
-
getInstance
public static TooltipManager getInstance()
-
-