use of com.kotcrab.vis.ui.widget.VisImageButton in project HyperLap2D by rednblackgames.
the class UIZoomBox method init.
private void init() {
addSeparator(true).padRight(13).padLeft(13);
add("Zoom:").padRight(4);
//
VisImageButton.VisImageButtonStyle zoominButtonStyle = new VisImageButton.VisImageButtonStyle(skin.get("dark", VisImageButton.VisImageButtonStyle.class));
zoominButtonStyle.imageUp = skin.getDrawable("icon-zoomin");
zoominButtonStyle.imageOver = skin.getDrawable("icon-zoomin-over");
zoominButtonStyle.imageDisabled = skin.getDrawable("icon-zoomin-disabled");
//
zoomInBtn = new VisImageButton("dark");
zoomInBtn.setStyle(zoominButtonStyle);
zoomInBtn.addListener(new UIZoomBoxButtonClickListener(0.5f));
add(zoomInBtn).padRight(6).height(25);
//
VisImageButton.VisImageButtonStyle zoomoutButtonStyle = new VisImageButton.VisImageButtonStyle(skin.get("dark", VisImageButton.VisImageButtonStyle.class));
zoomoutButtonStyle.imageUp = skin.getDrawable("icon-zoomout");
zoomoutButtonStyle.imageOver = skin.getDrawable("icon-zoomout-over");
zoomoutButtonStyle.imageDisabled = skin.getDrawable("icon-zoomout-disabled");
//
percentValueField = StandardWidgetsFactory.createTextField("light");
percentValueField.addListener(new KeyboardListener(ZOOM_VALUE_CHANGED));
percentValueField.setAlignment(Align.center);
add(percentValueField).width(50);
//
zoomOutBtn = new VisImageButton("dark");
zoomOutBtn.setStyle(zoomoutButtonStyle);
zoomOutBtn.addListener(new UIZoomBoxButtonClickListener(2f));
add(zoomOutBtn).padLeft(6).height(25);
}
Aggregations