Search in sources :

Example 1 with Category

use of games.rednblack.editor.plugin.tiled.view.Category in project HyperLap2D by rednblackgames.

the class OffsetPanel method initView.

private void initView() {
    offsetAttributeX = new AttributeVO(TILE_OFFSET_X, true);
    offsetAttributeY = new AttributeVO(TILE_OFFSET_Y, true);
    Array<AttributeVO> attributeVOs = new Array<>();
    attributeVOs.add(offsetAttributeX);
    attributeVOs.add(offsetAttributeY);
    offsetCategory = new Category(new CategoryVO("", attributeVOs));
    mainTable.add(offsetCategory).pad(7).row();
    VisTextButton addButton = new VisTextButton("Set");
    addButton.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            Vector2 offset = new Vector2(offsetAttributeX.value, offsetAttributeY.value);
            tiledPlugin.facade.sendNotification(TiledPlugin.TILE_GRID_OFFSET_ADDED, offset);
            super.clicked(event, x, y);
        }
    });
    mainTable.add(addButton);
}
Also used : Array(com.badlogic.gdx.utils.Array) VisTextButton(com.kotcrab.vis.ui.widget.VisTextButton) Category(games.rednblack.editor.plugin.tiled.view.Category) AttributeVO(games.rednblack.editor.plugin.tiled.data.AttributeVO) Vector2(com.badlogic.gdx.math.Vector2) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) CategoryVO(games.rednblack.editor.plugin.tiled.data.CategoryVO) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 2 with Category

use of games.rednblack.editor.plugin.tiled.view.Category in project HyperLap2D by rednblackgames.

the class SettingsTab method initView.

@Override
public void initView() {
    Array<AttributeVO> gridAttributes = new Array<>();
    gridAttributes.add(new AttributeVO("Width", currentParameters.gridWidth));
    gridAttributes.add(new AttributeVO("Height", currentParameters.gridHeight));
    CategoryVO gridVO = new CategoryVO("Grid size: ", gridAttributes);
    grid = new Category(gridVO);
    content.add(grid).expandX().colspan(2).padTop(10).left().top().row();
    panel.tiledPlugin.dataToSave.setParameterVO(currentParameters);
    VisTextButton okBtn = new VisTextButton("Save");
    content.add(okBtn).width(70).pad(20).colspan(2).expandX().center().bottom().row();
    okBtn.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            currentParameters.gridWidth = grid.getAttributeVO("Width: ").value;
            currentParameters.gridHeight = grid.getAttributeVO("Height: ").value;
            panel.getFacade().sendNotification(OK_BTN_CLICKED, currentParameters);
        }
    });
}
Also used : Array(com.badlogic.gdx.utils.Array) VisTextButton(com.kotcrab.vis.ui.widget.VisTextButton) Category(games.rednblack.editor.plugin.tiled.view.Category) AttributeVO(games.rednblack.editor.plugin.tiled.data.AttributeVO) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) CategoryVO(games.rednblack.editor.plugin.tiled.data.CategoryVO) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)2 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)2 Array (com.badlogic.gdx.utils.Array)2 VisTextButton (com.kotcrab.vis.ui.widget.VisTextButton)2 AttributeVO (games.rednblack.editor.plugin.tiled.data.AttributeVO)2 CategoryVO (games.rednblack.editor.plugin.tiled.data.CategoryVO)2 Category (games.rednblack.editor.plugin.tiled.view.Category)2 Vector2 (com.badlogic.gdx.math.Vector2)1