APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.ui

public Class Tooltip<T extends Actor>

extends InputListener
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.ui.TextTooltip
Imports
com.badlogic.gdx.Gdx, com.badlogic.gdx.math.Vector2, com.badlogic.gdx.scenes.scene2d.Actor, .InputEvent, .InputListener, .Stage, .Touchable, com.badlogic.gdx.utils.Null

A listener that shows a tooltip actor when the mouse is over another actor.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv final Container<T>
pack-priv boolean
private final TooltipManager
pack-priv Actor
pack-priv static Vector2
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
Tooltip(T
May be null.
contents
)

public
Tooltip(T
May be null.
contents
,
TooltipManager manager)

Method Summary

Modifier and TypeMethod and Description
public void
enter(InputEvent event, float x, float y, int pointer, Actor fromActor)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.enter.

Called any time the mouse cursor or a finger touch is moved over an actor.

public void
exit(InputEvent event, float x, float y, int pointer, Actor toActor)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.exit.

Called any time the mouse cursor or a finger touch is moved out of an actor.

public T
public Container<T>
public TooltipManager
public void
hide()

public boolean
mouseMoved(InputEvent event, float x, float y)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.mouseMoved.

Called any time the mouse is moved when a button is not down.

public void
setActor(T contents)

public void
setAlways(boolean always)

If true, this tooltip is shown even when tooltips are not TooltipManager#enabled.

private void
setContainerPosition(Actor actor, float x, float y)

public void
setInstant(boolean instant)

If true, this tooltip is shown without delay when hovered.

public void
setTouchIndependent(boolean touchIndependent)

If true, this tooltip will be shown even when screen is touched simultaneously with entering tooltip's targetActor

public boolean
touchDown(InputEvent event, float x, float y, int pointer, int button)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.touchDown.

Called when a mouse button or a finger touch goes down on the actor.

Inherited from com.badlogic.gdx.scenes.scene2d.InputListener:
handlekeyDownkeyTypedkeyUpscrolledtouchDraggedtouchUp

Field Detail

alwaysback to summary
pack-priv boolean always
containerback to summary
pack-priv final Container<T> container
instantback to summary
pack-priv boolean instant
managerback to summary
private final TooltipManager manager
targetActorback to summary
pack-priv Actor targetActor
tmpback to summary
pack-priv static Vector2 tmp
touchIndependentback to summary
pack-priv boolean touchIndependent

Constructor Detail

Tooltipback to summary
public Tooltip(T contents)
Parameters
contents:T

May be null.

Tooltipback to summary
public Tooltip(T contents, TooltipManager manager)
Parameters
contents:T

May be null.

Method Detail

enterback to summary
public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.enter.

Doc from com.badlogic.gdx.scenes.scene2d.InputListener.enter.

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).

exitback to summary
public void exit(InputEvent event, float x, float y, int pointer, Actor toActor)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.exit.

Doc from com.badlogic.gdx.scenes.scene2d.InputListener.exit.

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).

getActorback to summary
public T getActor()
Annotations
@Null
getContainerback to summary
public Container<T> getContainer()
getManagerback to summary
public TooltipManager getManager()
hideback to summary
public void hide()
mouseMovedback to summary
public boolean mouseMoved(InputEvent event, float x, float y)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.mouseMoved.

Doc from com.badlogic.gdx.scenes.scene2d.InputListener.mouseMoved.

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 is handled.

setActorback to summary
public void setActor(T contents)
setAlwaysback to summary
public void setAlways(boolean always)

If true, this tooltip is shown even when tooltips are not TooltipManager#enabled.

setContainerPositionback to summary
private void setContainerPosition(Actor actor, float x, float y)
setInstantback to summary
public void setInstant(boolean instant)

If true, this tooltip is shown without delay when hovered.

setTouchIndependentback to summary
public void setTouchIndependent(boolean touchIndependent)

If true, this tooltip will be shown even when screen is touched simultaneously with entering tooltip's targetActor

touchDownback to summary
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)

Overrides com.badlogic.gdx.scenes.scene2d.InputListener.touchDown.

Doc from com.badlogic.gdx.scenes.scene2d.InputListener.touchDown.

Called when a mouse button or a finger touch goes down on the actor. If true is returned, this listener will have touch 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 is handled.