use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class ConsoleDialog method addCloseButton.
@Override
public void addCloseButton() {
VisImageButton closeButton = new VisImageButton("close-properties");
this.getTitleTable().add(closeButton).padRight(0).padTop(0);
closeButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
close();
}
});
closeButton.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
event.cancel();
return true;
}
});
}
use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class UIRemovableProperties method crateHeaderTable.
@Override
public Table crateHeaderTable() {
VisTable header = new VisTable();
header.setTouchable(Touchable.enabled);
header.setBackground(VisUI.getSkin().getDrawable("expandable-properties-active-bg"));
VisImageButton collapseButton = StandardWidgetsFactory.createImageButton("expandable-properties-button");
VisImageButton closeButton = StandardWidgetsFactory.createImageButton("close-properties");
header.add(closeButton).left().padLeft(2);
header.add(StandardWidgetsFactory.createLabel(title)).left().expandX().padLeft(6);
header.add(collapseButton).right().padRight(8);
header.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
collapse(header);
}
});
closeButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
Dialogs.showConfirmDialog(Sandbox.getInstance().getUIStage(), "Delete Component", "Do you want to delete this component?", new String[] { "Cancel", "Delete" }, new Integer[] { 0, 1 }, r -> {
if (r == 1) {
onRemove();
remove();
}
}).padBottom(20).pack();
}
});
closeButton.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
event.cancel();
return true;
}
});
return header;
}
use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class EditSpriteAnimationPanel method updateView.
public void updateView(Map<String, FrameRange> frameRangeMap) {
createNewAnimationTable(frameRangeMap.get("Default").endFrame);
animationsList.clear();
for (Map.Entry<String, FrameRange> entry : frameRangeMap.entrySet()) {
String animationName = entry.getKey();
FrameRange range = entry.getValue();
VisTable row = new VisTable();
VisImageButton trashBtn = new VisImageButton("trash-button");
row.add(StandardWidgetsFactory.createLabel(animationName)).width(120).left();
row.add(StandardWidgetsFactory.createLabel(range.startFrame + "")).width(50).left();
row.add(StandardWidgetsFactory.createLabel(range.endFrame + "")).width(50).left();
if (!animationName.equals("Default"))
row.add(trashBtn).padLeft(10);
row.row();
animationsList.add(row).left();
animationsList.row();
trashBtn.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
facade.sendNotification(DELETE_BUTTON_PRESSED, animationName);
}
});
}
invalidateHeight();
}
use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class UIResourcesTab method createFilterButton.
protected VisImageButton createFilterButton() {
VisImageButton button = StandardWidgetsFactory.createImageButton("filter-button");
button.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
HyperLap2DFacade facade = HyperLap2DFacade.getInstance();
Vector2 pos = Pools.obtain(Vector2.class);
pos.set(0, 0);
button.localToStageCoordinates(pos);
Object[] payload = new Object[] { pos.x, pos.y, getTabTitle() };
facade.sendNotification(UIFilterMenu.SHOW_FILTER_MENU, payload);
Pools.free(pos);
}
});
return button;
}
use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class UIToolBox method createButton.
private VisImageButton createButton(VisImageButton.VisImageButtonStyle btnStyle, String toolId) {
VisImageButton visImageButton = new VisImageButton(btnStyle);
toolsButtonGroup.add(visImageButton);
visImageButton.addListener(new ToolboxButtonClickListener(toolId));
return visImageButton;
}
Aggregations