Search in sources :

Example 26 with VisTable

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

the class UIItemCollapsibleProperties method createCollapsibleWidget.

private void createCollapsibleWidget() {
    mainTable = new VisTable();
    collapsibleWidget = new CollapsibleWidget(mainTable);
    row();
    add(collapsibleWidget).expand();
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) CollapsibleWidget(com.kotcrab.vis.ui.widget.CollapsibleWidget)

Example 27 with VisTable

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

the class UIItemCollapsibleProperties method crateHeaderTable.

public Table crateHeaderTable() {
    header = new VisTable();
    header.setTouchable(Touchable.enabled);
    header.setBackground(VisUI.getSkin().getDrawable("expandable-properties-active-bg"));
    header.add(StandardWidgetsFactory.createLabel(title)).left().expandX().padRight(6).padLeft(8);
    VisImageButton button = StandardWidgetsFactory.createImageButton("expandable-properties-button");
    header.add(button).padRight(8);
    header.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            collapse(header);
        }
    });
    return header;
}
Also used : VisImageButton(com.kotcrab.vis.ui.widget.VisImageButton) VisTable(com.kotcrab.vis.ui.widget.VisTable) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 28 with VisTable

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

the class ProjectExportSettings method getDimensionsTable.

private Table getDimensionsTable() {
    Integer[] data = { 512, 1024, 2048, 4096 };
    VisTable dimensionsTable = new VisTable();
    widthSelectBox.setItems(data);
    dimensionsTable.add(new VisLabel("Width:")).left().padRight(3);
    dimensionsTable.add(widthSelectBox).width(85).height(21).padRight(3);
    dimensionsTable.row().padTop(10);
    heightSelectBox.setItems(data);
    dimensionsTable.add(new VisLabel("Height:")).left().padRight(3);
    dimensionsTable.add(heightSelectBox).width(85).height(21).left();
    return dimensionsTable;
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) VisLabel(com.kotcrab.vis.ui.widget.VisLabel)

Example 29 with VisTable

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

the class AbstractGridTilesTab method initTiles.

private void initTiles(String tileName, int type) {
    content.clear();
    tiles.clear();
    VisTable listTable = new VisTable();
    pane = StandardWidgetsFactory.createScrollPane(listTable);
    pane.setScrollingDisabled(true, false);
    content.add(pane).padTop(10);
    listTable.top();
    if (tileIndex >= tilesCount && !tileName.equals("")) {
        tilesCount = tileIndex + 1;
    }
    for (int i = 0; i < tilesCount + 1; i++) {
        VisImageButton ct;
        VisImageButton.VisImageButtonStyle imageBoxStyle = new VisImageButton.VisImageButtonStyle();
        NinePatchDrawable inactive = new NinePatchDrawable(new NinePatch(resourcesManager.getPluginNinePatch("image-Box-inactive")));
        NinePatchDrawable active = new NinePatchDrawable(new NinePatch(resourcesManager.getPluginNinePatch("image-Box-active")));
        imageBoxStyle.up = inactive;
        imageBoxStyle.down = active;
        imageBoxStyle.checked = active;
        imageBoxStyle.over = active;
        Drawable tileDrawable = null;
        if (i < savedTiles.size) {
            int t = savedTiles.get(i).getEntityType();
            if (t == SpineItemType.SPINE_TYPE) {
                tileDrawable = resourcesManager.getSpineDrawable(savedTiles.get(i).getRegionName());
            } else {
                tileDrawable = new TextureRegionDrawable(resourcesManager.getTextureRegion(savedTiles.get(i).getRegionName(), t));
            }
        } else if (!tileName.equals("")) {
            if (i == tileIndex) {
                if (type == SpineItemType.SPINE_TYPE) {
                    tileDrawable = resourcesManager.getSpineDrawable(tileName);
                } else {
                    tileDrawable = new TextureRegionDrawable(resourcesManager.getTextureRegion(tileName, type));
                }
            }
        }
        imageBoxStyle.imageUp = tileDrawable;
        imageBoxStyle.imageDown = tileDrawable;
        imageBoxStyle.imageChecked = tileDrawable;
        imageBoxStyle.imageOver = tileDrawable;
        ct = new VisImageButton(imageBoxStyle);
        if (i < savedTiles.size) {
            ct.setUserObject(savedTiles.get(i).getRegionName());
        }
        int index = i;
        ct.addListener(getGridTabInputListener(index));
        listTable.add(ct).width(40).height(40).pad(3);
        if ((i + 1) % 4 == 0) {
            listTable.row();
        }
        tiles.add(ct);
    }
    content.pack();
}
Also used : VisImageButton(com.kotcrab.vis.ui.widget.VisImageButton) VisTable(com.kotcrab.vis.ui.widget.VisTable) NinePatch(com.badlogic.gdx.graphics.g2d.NinePatch) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) Drawable(com.badlogic.gdx.scenes.scene2d.utils.Drawable) SpineDrawable(games.rednblack.editor.plugin.tiled.view.SpineDrawable) NinePatchDrawable(com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) NinePatchDrawable(com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)

Example 30 with VisTable

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

the class UIAnimationsTab method crateScrollPane.

@Override
protected VisScrollPane crateScrollPane() {
    animationsTable = new VisTable();
    HyperLap2DFacade.getInstance().sendNotification(UIResourcesBoxMediator.ADD_RESOURCES_BOX_TABLE_SELECTION_MANAGEMENT, animationsTable);
    VisScrollPane scrollPane = StandardWidgetsFactory.createScrollPane(animationsTable);
    scrollPane.setScrollingDisabled(true, false);
    return scrollPane;
}
Also used : VisTable(com.kotcrab.vis.ui.widget.VisTable) VisScrollPane(com.kotcrab.vis.ui.widget.VisScrollPane)

Aggregations

VisTable (com.kotcrab.vis.ui.widget.VisTable)35 VisLabel (com.kotcrab.vis.ui.widget.VisLabel)11 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)7 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)7 Actor (com.badlogic.gdx.scenes.scene2d.Actor)6 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)6 VisImageButton (com.kotcrab.vis.ui.widget.VisImageButton)6 JsonValue (com.badlogic.gdx.utils.JsonValue)4 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)3 GraphBoxImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl)3 GraphBoxPartImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxPartImpl)3 VisSelectBox (com.kotcrab.vis.ui.widget.VisSelectBox)3 Color (com.badlogic.gdx.graphics.Color)2 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)2 ClampMethod (com.gempukku.libgdx.graph.shader.ClampMethod)2 GraphChangedEvent (com.gempukku.libgdx.graph.ui.graph.GraphChangedEvent)2 VisProgressBar (com.kotcrab.vis.ui.widget.VisProgressBar)2 VisSlider (com.kotcrab.vis.ui.widget.VisSlider)2 VisSplitPane (com.kotcrab.vis.ui.widget.VisSplitPane)2 VisTextButton (com.kotcrab.vis.ui.widget.VisTextButton)2