com.badlogic.gdx.scenes.scene2d.ui.Window Java Examples

The following examples show how to use com.badlogic.gdx.scenes.scene2d.ui.Window. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BottomMenu.java    From Norii with Apache License 2.0 6 votes vote down vote up
private void initStatsMenu() {
	final Skin statusUISkin = Utility.getStatusUISkin();

	statsGroup = new Window("", statusUISkin);

	heroNameLabel = new Label("", statusUISkin);
	hpLabel = new Label(" hp:", statusUISkin);
	hp = new Label("", statusUISkin);
	apLabel = new Label(" ap:", statusUISkin);
	ap = new Label("", statusUISkin);
	xpLabel = new Label(" xp:", statusUISkin);
	xp = new Label("", statusUISkin);
	levelLabel = new Label(" lv:", statusUISkin);
	levelVal = new Label("", statusUISkin);
	iniLabel = new Label(" ini:", statusUISkin);
	iniVal = new Label("", statusUISkin);

	final Color newStatsGroupColor = statsGroup.getColor();
	newStatsGroupColor.a = ALPHA;
}
 
Example #2
Source File: BottomMenu.java    From Norii with Apache License 2.0 5 votes vote down vote up
private void setBackgroundColor(final Window window) {
	if (linkedEntity.isPlayerUnit()) {
		window.setColor(GOOD_COLOR);
	} else {
		window.setColor(BAD_COLOR);
	}
}
 
Example #3
Source File: UIWindow.java    From Norii with Apache License 2.0 5 votes vote down vote up
protected void setBackgroundColor(Window window, Entity entity) {
	if (entity.isPlayerUnit()) {
		window.setColor(GOOD_COLOR);
	} else {
		window.setColor(BAD_COLOR);
	}
}
 
Example #4
Source File: InterfaceScalingDialogController.java    From gdx-texture-packer-gui with Apache License 2.0 5 votes vote down vote up
@Override
public void doBeforeShow(Window dialog) {
    float scale = 1f / viewportService.getScale();

    lblUiScale.setText(formatScaleValue(scale));
    sliderUiScale.setValue(scale);
}
 
Example #5
Source File: VisTextField.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
private VisTextField findNextTextField (Array<Actor> actors, VisTextField best, Vector2 bestCoords, Vector2 currentCoords, boolean up) {
	Window modalWindow = findModalWindow(this);

	for (int i = 0, n = actors.size; i < n; i++) {
		Actor actor = actors.get(i);
		if (actor == this) continue;
		if (actor instanceof VisTextField) {
			VisTextField textField = (VisTextField) actor;

			if (modalWindow != null) {
				Window nextFieldModalWindow = findModalWindow(textField);
				if (nextFieldModalWindow != modalWindow) continue;
			}

			if (textField.isDisabled() || !textField.focusTraversal || isActorVisibleInStage(textField) == false)
				continue;

			Vector2 actorCoords = actor.getParent().localToStageCoordinates(tmp3.set(actor.getX(), actor.getY()));
			if ((actorCoords.y < currentCoords.y || (actorCoords.y == currentCoords.y && actorCoords.x > currentCoords.x)) ^ up) {
				if (best == null
						|| (actorCoords.y > bestCoords.y || (actorCoords.y == bestCoords.y && actorCoords.x < bestCoords.x)) ^ up) {
					best = (VisTextField) actor;
					bestCoords.set(actorCoords);
				}
			}
		} else if (actor instanceof Group)
			best = findNextTextField(((Group) actor).getChildren(), best, bestCoords, currentCoords, up);
	}
	return best;
}
 
Example #6
Source File: ExtensionModulesDialogController.java    From gdx-texture-packer-gui with Apache License 2.0 4 votes vote down vote up
@Override
public void doBeforeShow(Window dialog) {
    moduleRepository.requestRefreshRepositoryIfNeeded();
}
 
Example #7
Source File: AbstractConsole.java    From libgdx-inGameConsole with Apache License 2.0 4 votes vote down vote up
@Override public Window getWindow () {
	return null;
}
 
Example #8
Source File: VisTextField.java    From vis-ui with Apache License 2.0 4 votes vote down vote up
private Window findModalWindow (Actor actor) {
	if (actor == null) return null;
	if (actor instanceof Window && ((Window) actor).isModal()) return (Window) actor;
	return findModalWindow(actor.getParent());
}
 
Example #9
Source File: ModalTaskDialogController.java    From gdx-texture-packer-gui with Apache License 2.0 2 votes vote down vote up
@Override
public void doBeforeShow(Window dialog) {

}
 
Example #10
Source File: Console.java    From libgdx-inGameConsole with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the Console's Window object.
 *
 * @return The window.
 */
Window getWindow ();