Package arc.scene.ui

Class Tooltip

All Implemented Interfaces:
EventListener

public class Tooltip extends InputListener
A listener that shows a tooltip element when another element is hovered over with the mouse.
  • Field Details

    • manager

      public final Tooltip.Tooltips manager
    • container

      public final Table container
    • allowMobile

      public boolean allowMobile
    • instant

      public boolean instant
    • always

      public boolean always
    • targetActor

      protected Element targetActor
    • show

      protected Runnable show
  • Constructor Details

  • Method Details

    • getManager

      public Tooltip.Tooltips getManager()
    • getContainer

      public Table getContainer()
    • 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 not Tooltip.Tooltips.enabled.
    • touchDown

      public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button)
      Description copied from class: InputListener
      Called when a mouse button or a finger touch goes down on the element. If true is returned, this listener will receive all touchDragged and touchUp events, even those not over this element, until touchUp is received. Also when true is returned, the event is handled.
      Overrides:
      touchDown in class InputListener
      See Also:
    • touchUp

      public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button)
      Description copied from class: InputListener
      Called when a mouse button or a finger touch goes up anywhere, but only if touchDown previously returned true for the mouse button or touch. The touchUp event is always handled.
      Overrides:
      touchUp in class InputListener
      See Also:
    • mouseMoved

      public boolean mouseMoved(InputEvent event, float x, float y)
      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 is handled.
      Overrides:
      mouseMoved in class InputListener
      See Also:
    • setContainerPosition

      protected void setContainerPosition(Element element, float x, float y)
    • enter

      public void enter(InputEvent event, float x, float y, int pointer, Element fromActor)
      Description copied from class: InputListener
      Called any time the mouse cursor or a finger touch is moved over an element. On the desktop, this event occurs even when no mouse buttons are pressed (pointer will be -1).
      Overrides:
      enter in class InputListener
      fromActor - May be null.
      See Also:
    • exit

      public void exit(InputEvent event, float x, float y, int pointer, Element toActor)
      Description copied from class: InputListener
      Called any time the mouse cursor or a finger touch is moved out of an element. On the desktop, this event occurs even when no mouse buttons are pressed (pointer will be -1).
      Overrides:
      exit in class InputListener
      toActor - May be null.
      See Also:
    • show

      public void show(Element element, float x, float y)
    • hide

      public void hide()