use of com.badlogic.gdx.scenes.scene2d.ui.TextTooltip in project bladecoder-adventure-engine by bladecoder.
the class ProjectToolbar method addToolBarButton.
private void addToolBarButton(Skin skin, ImageButton button, String icon, String text, String tooltip) {
ImageButtonStyle style = new ImageButtonStyle(skin.get(ButtonStyle.class));
TextureRegion image = Ctx.assetManager.getIcon(icon);
style.imageUp = new TextureRegionDrawable(image);
try {
TextureRegion imageDisabled = Ctx.assetManager.getIcon(icon + "_disabled");
if (imageDisabled != null)
style.imageDisabled = new TextureRegionDrawable(imageDisabled);
} catch (Exception e) {
}
button.setStyle(style);
// button.row();
// button.add(new Label(text, skin));
add(button);
button.setDisabled(true);
TextTooltip t = new TextTooltip(tooltip, skin);
button.addListener(t);
}
Aggregations