use of com.mobidevelop.maps.editor.ui.utils.Tooltips in project gdx-skineditor by cobolfoo.
the class WidgetsBar method initializeButtons.
/**
*/
public void initializeButtons() {
group = new ButtonGroup();
Tooltips.TooltipStyle styleTooltip = new Tooltips.TooltipStyle(game.skin.getFont("default-font"), game.skin.getDrawable("default-round"), game.skin.getColor("white"));
String[] widgets = SkinEditorGame.widgets;
for (String widget : widgets) {
ImageButtonStyle style = new ImageButtonStyle();
style.checked = game.skin.getDrawable("default-round-down");
style.down = game.skin.getDrawable("default-round-down");
style.up = game.skin.getDrawable("default-round");
style.imageUp = game.skin.getDrawable("widgets/" + widget);
ImageButton button = new ImageButton(style);
button.setUserObject(widget);
Tooltips tooltip = new Tooltips(styleTooltip, getStage());
tooltip.registerTooltip(button, (String) button.getUserObject());
button.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
game.screenMain.panePreview.refresh();
game.screenMain.paneOptions.refresh();
}
});
group.add(button);
add(button).pad(5);
}
}
Aggregations