Search in sources :

Example 21 with VisImageButton

use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.

the class UIZoomBox method init.

private void init() {
    addSeparator(true).padRight(13).padLeft(13);
    add("Zoom:").padRight(4);
    // 
    VisImageButton.VisImageButtonStyle zoominButtonStyle = new VisImageButton.VisImageButtonStyle(skin.get("dark", VisImageButton.VisImageButtonStyle.class));
    zoominButtonStyle.imageUp = skin.getDrawable("icon-zoomin");
    zoominButtonStyle.imageOver = skin.getDrawable("icon-zoomin-over");
    zoominButtonStyle.imageDisabled = skin.getDrawable("icon-zoomin-disabled");
    // 
    zoomInBtn = new VisImageButton("dark");
    zoomInBtn.setStyle(zoominButtonStyle);
    zoomInBtn.addListener(new UIZoomBoxButtonClickListener(0.5f));
    add(zoomInBtn).padRight(6).height(25);
    // 
    VisImageButton.VisImageButtonStyle zoomoutButtonStyle = new VisImageButton.VisImageButtonStyle(skin.get("dark", VisImageButton.VisImageButtonStyle.class));
    zoomoutButtonStyle.imageUp = skin.getDrawable("icon-zoomout");
    zoomoutButtonStyle.imageOver = skin.getDrawable("icon-zoomout-over");
    zoomoutButtonStyle.imageDisabled = skin.getDrawable("icon-zoomout-disabled");
    // 
    percentValueField = StandardWidgetsFactory.createTextField("light");
    percentValueField.addListener(new KeyboardListener(ZOOM_VALUE_CHANGED));
    percentValueField.setAlignment(Align.center);
    add(percentValueField).width(50);
    // 
    zoomOutBtn = new VisImageButton("dark");
    zoomOutBtn.setStyle(zoomoutButtonStyle);
    zoomOutBtn.addListener(new UIZoomBoxButtonClickListener(2f));
    add(zoomOutBtn).padLeft(6).height(25);
}
Also used : VisImageButton(com.kotcrab.vis.ui.widget.VisImageButton) KeyboardListener(games.rednblack.editor.event.KeyboardListener)

Aggregations

VisImageButton (com.kotcrab.vis.ui.widget.VisImageButton)21 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)7 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)7 VisTable (com.kotcrab.vis.ui.widget.VisTable)6 Actor (com.badlogic.gdx.scenes.scene2d.Actor)5 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)4 Drawable (com.badlogic.gdx.scenes.scene2d.utils.Drawable)4 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)4 VisLabel (com.kotcrab.vis.ui.widget.VisLabel)2 NinePatch (com.badlogic.gdx.graphics.g2d.NinePatch)1 Vector2 (com.badlogic.gdx.math.Vector2)1 Touchable (com.badlogic.gdx.scenes.scene2d.Touchable)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 SelectBox (com.badlogic.gdx.scenes.scene2d.ui.SelectBox)1 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)1 NinePatchDrawable (com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)1 VisUI (com.kotcrab.vis.ui.VisUI)1 FloatValidator (com.kotcrab.vis.ui.util.Validators.FloatValidator)1 Dialogs (com.kotcrab.vis.ui.util.dialog.Dialogs)1 VisImageTextButton (com.kotcrab.vis.ui.widget.VisImageTextButton)1