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

public class Tooltip<T extends Actor> extends InputListener
A listener that shows a tooltip actor when the mouse is over another actor.
Author:
Nathan Sweet
  • Constructor Details

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

    • getManager

      public TooltipManager getManager()
    • 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:
    • 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:
    • 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:
    • 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:
    • hide

      public void hide()