Class Tooltip<T extends Actor>

  • 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 Detail

      • Tooltip

        public Tooltip​(@Null
                       T contents)
        Parameters:
        contents - May be null.
      • Tooltip

        public Tooltip​(@Null
                       T contents,
                       TooltipManager manager)
        Parameters:
        contents - May be null.
    • Method Detail

      • getContainer

        public Container<T> getContainer()
      • setActor

        public void setActor​(@Null
                             T contents)
      • getActor

        @Null
        public T 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 not TooltipManager.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: InputListener
        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.
        Overrides:
        touchDown in class InputListener
        See Also:
        InputEvent
      • 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:
        InputEvent
      • enter

        public void enter​(InputEvent event,
                          float x,
                          float y,
                          int pointer,
                          @Null
                          Actor fromActor)
        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 class InputListener
        fromActor - 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: 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 class InputListener
        toActor - May be null.
        See Also:
        InputEvent
      • hide

        public void hide()