Class Tooltip<T extends Actor>
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.InputListener
-
- com.badlogic.gdx.scenes.scene2d.ui.Tooltip<T>
-
- All Implemented Interfaces:
EventListener
- Direct Known Subclasses:
TextTooltip
public class Tooltip<T extends Actor> extends InputListener
A listener that shows a tooltip actor when the mouse is over another actor.
-
-
Constructor Summary
Constructors Constructor Description Tooltip(T contents)Tooltip(T contents, TooltipManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenter(InputEvent event, float x, float y, int pointer, Actor fromActor)Called any time the mouse cursor or a finger touch is moved over an actor.voidexit(InputEvent event, float x, float y, int pointer, Actor toActor)Called any time the mouse cursor or a finger touch is moved out of an actor.TgetActor()Container<T>getContainer()TooltipManagergetManager()voidhide()booleanmouseMoved(InputEvent event, float x, float y)Called any time the mouse is moved when a button is not down.voidsetActor(T contents)voidsetAlways(boolean always)If true, this tooltip is shown even when tooltips are notTooltipManager.enabled.voidsetInstant(boolean instant)If true, this tooltip is shown without delay when hovered.voidsetTouchIndependent(boolean touchIndependent)If true, this tooltip will be shown even when screen is touched simultaneously with entering tooltip's targetActorbooleantouchDown(InputEvent event, float x, float y, int pointer, int button)Called when a mouse button or a finger touch goes down on the actor.-
Methods inherited from class com.badlogic.gdx.scenes.scene2d.InputListener
handle, keyDown, keyTyped, keyUp, scrolled, touchDragged, touchUp
-
-
-
-
Constructor Detail
-
Tooltip
public Tooltip(@Null T contents, TooltipManager manager)
- Parameters:
contents- May be null.
-
-
Method Detail
-
getManager
public TooltipManager getManager()
-
setInstant
public void setInstant(boolean instant)
If true, this tooltip is shown without delay when hovered.
-
setAlways
public void setAlways(boolean always)
If true, this tooltip is shown even when tooltips are notTooltipManager.enabled.
-
setTouchIndependent
public void setTouchIndependent(boolean touchIndependent)
If true, this tooltip will be shown even when screen is touched simultaneously with entering tooltip's targetActor
-
touchDown
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
Description copied from class:InputListenerCalled when a mouse button or a finger touch goes down on the actor. If true is returned, this listener will havetouch focus, so it will receive all touchDragged and touchUp events, even those not over this actor, until touchUp is received. Also when true is returned, the event ishandled.- Overrides:
touchDownin classInputListener- See Also:
InputEvent
-
mouseMoved
public boolean mouseMoved(InputEvent event, float x, float y)
Description copied from class:InputListenerCalled any time the mouse is moved when a button is not down. This event only occurs on the desktop. When true is returned, the event ishandled.- Overrides:
mouseMovedin classInputListener- See Also:
InputEvent
-
enter
public void enter(InputEvent event, float x, float y, int pointer, @Null Actor fromActor)
Description copied from class:InputListenerCalled any time the mouse cursor or a finger touch is moved over an actor. On the desktop, this event occurs even when no mouse buttons are pressed (pointer will be -1).- Overrides:
enterin classInputListenerfromActor- May be null.- See Also:
InputEvent
-
exit
public void exit(InputEvent event, float x, float y, int pointer, @Null Actor toActor)
Description copied from class:InputListenerCalled any time the mouse cursor or a finger touch is moved out of an actor. On the desktop, this event occurs even when no mouse buttons are pressed (pointer will be -1).- Overrides:
exitin classInputListenertoActor- May be null.- See Also:
InputEvent
-
hide
public void hide()
-
-