Package com.prineside.tdi2.scene2d.ui
Class Tooltip<T extends Actor>
java.lang.Object
com.prineside.tdi2.scene2d.InputListener
com.prineside.tdi2.scene2d.ui.Tooltip<T>
- All Implemented Interfaces:
EventListener
- Direct Known Subclasses:
TextTooltip
A listener that shows a tooltip actor when the mouse is over another actor.
- Author:
- Nathan Sweet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
enter
(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.void
exit
(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.getActor()
void
hide()
boolean
mouseMoved
(InputEvent event, float x, float y) Called any time the mouse is moved when a button is not down.void
void
setAlways
(boolean always) If true, this tooltip is shown even when tooltips are notTooltipManager.enabled
.void
setInstant
(boolean instant) If true, this tooltip is shown without delay when hovered.void
setTouchIndependent
(boolean touchIndependent) If true, this tooltip will be shown even when screen is touched simultaneously with entering tooltip's targetActorboolean
touchDown
(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.prineside.tdi2.scene2d.InputListener
handle, keyDown, keyTyped, keyUp, scrolled, touchDragged, touchUp
-
Constructor Details
-
Tooltip
- Parameters:
contents
- May be null.
-
Tooltip
- Parameters:
contents
- May be null.
-
-
Method Details
-
getManager
-
getContainer
-
setActor
-
getActor
-
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
Description copied from class:InputListener
Called 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:
touchDown
in classInputListener
- See Also:
-
mouseMoved
Description copied from class:InputListener
Called 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:
mouseMoved
in classInputListener
- See Also:
-
enter
Description copied from class:InputListener
Called 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:
enter
in classInputListener
fromActor
- May be null.- See Also:
-
exit
Description copied from class:InputListener
Called 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:
exit
in classInputListener
toActor
- May be null.- See Also:
-
hide
public void hide()
-