use of com.kotcrab.vis.ui.widget.VisImageButton in project vis-ui by kotcrab.
the class TestGenerateDisabledImage method addVisWidgets.
private void addVisWidgets() {
Drawable icon = VisUI.getSkin().getDrawable("icon-folder");
VisImageButton normal = new VisImageButton(icon);
VisImageButton disabled = new VisImageButton(icon);
disabled.setGenerateDisabledImage(true);
disabled.setDisabled(true);
add(new VisLabel("VisImageButton normal"));
add(normal).row();
add(new VisLabel("VisImageButton disabled"));
add(disabled).row();
VisImageTextButton normalText = new VisImageTextButton("text", icon);
VisImageTextButton disabledText = new VisImageTextButton("text", icon);
disabledText.setGenerateDisabledImage(true);
disabledText.setDisabled(true);
add(new VisLabel("VisImageTextButton normal"));
add(normalText).row();
add(new VisLabel("VisImageTextButton disabled"));
add(disabledText).padBottom(3f).row();
}
use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class UIToolBox method addToolButton.
public void addToolButton(String name, VisImageButton.VisImageButtonStyle btnStyle, Tool tool) {
VisImageButton button = createButton(btnStyle, name);
String toolTip = tool.getTitle() + (tool.getShortcut() != null ? " (" + tool.getShortcut() + ")" : "");
StandardWidgetsFactory.addTooltip(button, toolTip);
buttonMap.put(name, button);
add(button).width(31).height(31).row();
}
use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class UIAlignBox method createAlignButton.
private VisImageButton createAlignButton(String styleName, int alignment, String title) {
VisImageButton visImageButton = new VisImageButton(styleName);
visImageButton.addListener(new AlignmentButtonClickListener(alignment));
StandardWidgetsFactory.addTooltip(visImageButton, title);
return visImageButton;
}
use of com.kotcrab.vis.ui.widget.VisImageButton 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;
}
use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class AlternativeAutoTileDialog method updateVisImageButton.
/**
* Updates the given button with the given image.
*
* @param button The button to update.
* @param regionName The name of the new image.
*/
private void updateVisImageButton(VisImageButton button, String regionName) {
VisImageButton.VisImageButtonStyle imageBoxStyle = button.getStyle();
Drawable tileDrawable = null;
if (!"".equals(regionName)) {
tileDrawable = new TextureRegionDrawable(tiledPlugin.pluginRM.getTextureRegion(regionName, EntityFactory.IMAGE_TYPE));
}
imageBoxStyle.imageUp = tileDrawable;
imageBoxStyle.imageDown = tileDrawable;
imageBoxStyle.imageChecked = tileDrawable;
imageBoxStyle.imageOver = tileDrawable;
button.setStyle(imageBoxStyle);
}
Aggregations