Search in sources :

Example 1 with AlphaImage

use of com.kotcrab.vis.ui.widget.color.internal.AlphaImage in project vis-ui by kotcrab.

the class BasicColorPicker method createColorsPreviewTable.

private VisTable createColorsPreviewTable() {
    VisTable table = new VisTable(false);
    table.add(currentColorImg = new AlphaImage(commons, 5 * sizes.scaleFactor)).height(25 * sizes.scaleFactor).width(80 * sizes.scaleFactor).expandX().fillX();
    table.add(new Image(style.iconArrowRight)).pad(0, 2, 0, 2);
    table.add(newColorImg = new AlphaImage(commons, 5 * sizes.scaleFactor)).height(25 * sizes.scaleFactor).width(80 * sizes.scaleFactor).expandX().fillX();
    currentColorImg.setColor(color);
    newColorImg.setColor(color);
    currentColorImg.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            restoreLastColor();
        }
    });
    return table;
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) AlphaImage(com.kotcrab.vis.ui.widget.color.internal.AlphaImage) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) AlphaImage(com.kotcrab.vis.ui.widget.color.internal.AlphaImage) Image(com.badlogic.gdx.scenes.scene2d.ui.Image) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 VisTable (com.kotcrab.vis.ui.widget.VisTable)1 AlphaImage (com.kotcrab.vis.ui.widget.color.internal.AlphaImage)1