Search in sources :

Example 11 with TextTooltip

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);
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) TextTooltip(com.badlogic.gdx.scenes.scene2d.ui.TextTooltip) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) ImageButtonStyle(com.badlogic.gdx.scenes.scene2d.ui.ImageButton.ImageButtonStyle) ImageButtonStyle(com.badlogic.gdx.scenes.scene2d.ui.ImageButton.ImageButtonStyle) ButtonStyle(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle) IOException(java.io.IOException)

Aggregations

TextTooltip (com.badlogic.gdx.scenes.scene2d.ui.TextTooltip)11 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)9 Actor (com.badlogic.gdx.scenes.scene2d.Actor)8 Button (com.badlogic.gdx.scenes.scene2d.ui.Button)8 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)8 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)8 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)8 SelectBox (com.badlogic.gdx.scenes.scene2d.ui.SelectBox)5 DrawableData (com.ray3k.skincomposer.data.DrawableData)5 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)4 ImageButton (com.badlogic.gdx.scenes.scene2d.ui.ImageButton)4 ImageButtonStyle (com.badlogic.gdx.scenes.scene2d.ui.ImageButton.ImageButtonStyle)4 ScrollPane (com.badlogic.gdx.scenes.scene2d.ui.ScrollPane)4 TextField (com.badlogic.gdx.scenes.scene2d.ui.TextField)4 Array (com.badlogic.gdx.utils.Array)4 ColorData (com.ray3k.skincomposer.data.ColorData)4 StyleData (com.ray3k.skincomposer.data.StyleData)4 StyleProperty (com.ray3k.skincomposer.data.StyleProperty)4 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)3 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)3