Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Tooltip can be attached to any actor, only one tooltip can be attached to actor at the same time. By default tooltip appears bellow actor, however if there is not enough space bellow actor, tooltip will be displayed above it.
Tooltip has only basic constructors taking style this is because tooltips are meant to be created using
Example, creating tooltip for
VisLabel labelWithTooltip = new VisLabel("label with tooltip"); new Tooltip.Builder("this label has a tooltip").target(labelWithTooltip).build();
Detaching any tooltip from actor:
As you can see tooltips are not part of actor (i.e. method like
actor.setTooltip(...) does not exist). Tooltips works by attaching listener to target actor, if you remove that listener from actor (for example by calling
actor.clearListeners()) then you have to attach tooltip again by calling
tooltip.attach(), you can also remove tooltip manually by calling
Tooltip target can be changed by calling
tooltip.setTarget(Actor newTarget), this will automatically detach tooltip from old target and attach it to new target.
VisImageButton has constructor that allows to add tooltip alongside with button icon, for example (code from showcase):
VisImageButton exploreButton = new VisImageButton(folderIconDrawable, "Explore"); VisImageButton settingsButton = new VisImageButton(settingsIconDrawable, "Change view"); VisImageButton importButton = new VisImageButton(importIconDrawable, "Import");