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

The following examples show how to use com.badlogic.gdx.scenes.scene2d.ui.CheckBox. 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: SystemProfilerGUI.java    From riiablo with Apache License 2.0 6 votes vote down vote up
public ProfilerRow(SystemProfiler profiler, Skin skin) {
  super();
  draw = new CheckBox("", skin);
  name = new Label("", skin, STYLE_SMALL);
  name.setEllipsis(true);
  max = label("", skin, Align.right);
  localMax = label("", skin, Align.right);
  avg = label("", skin, Align.right);
  add(draw);
  add(name).expandX().fillX();
  ;
  add(max).minWidth(MIN_LABEL_WIDTH);
  add(localMax).minWidth(MIN_LABEL_WIDTH);
  add(avg).minWidth(MIN_LABEL_WIDTH);

  if (profiler != null) init(profiler);
}
 
Example #2
Source File: CheckboxWidget.java    From talos with Apache License 2.0 5 votes vote down vote up
@Override
public Actor getSubWidget() {
	checkBox = new CheckBox("", TalosMain.Instance().getSkin(), "panel-checkbox");

	listener = new ChangeListener() {
		@Override
		public void changed(ChangeEvent event, Actor actor) {
			valueChanged(checkBox.isChecked());
		}
	};
	checkBox.addListener(listener);

	return checkBox;
}
 
Example #3
Source File: UIUtils.java    From uracer-kotd with Apache License 2.0 5 votes vote down vote up
public static CheckBox newCheckBox (String text, boolean checked, ChangeListener listener) {
	CheckBox cb = new CheckBox(" " + text, Art.scrSkin);
	cb.setChecked(checked);
	if (listener != null) {
		cb.addListener(listener);
	}
	return cb;
}
 
Example #4
Source File: Scene2dSteeringTest.java    From gdx-ai with Apache License 2.0 5 votes vote down vote up
protected void addAlignOrientationToLinearVelocityController (Table table, final SteeringActor character) {
	CheckBox alignOrient = new CheckBox("Align orient.to velocity", container.skin);
	alignOrient.setChecked(character.isIndependentFacing());
	alignOrient.addListener(new ClickListener() {
		@Override
		public void clicked (InputEvent event, float x, float y) {
			CheckBox checkBox = (CheckBox)event.getListenerActor();
			character.setIndependentFacing(checkBox.isChecked());
		}
	});
	table.add(alignOrient);
}
 
Example #5
Source File: CheckBoxTextSpaceLmlAttribute.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
@Override
public Class<CheckBox> getHandledType() {
    return CheckBox.class;
}
 
Example #6
Source File: CheckBoxTextSpaceLmlAttribute.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
@Override
public void process(final LmlParser parser, final LmlTag tag, final CheckBox actor, final String rawAttributeData) {
    int space = parser.parseInt(rawAttributeData, actor);
    actor.getLabelCell().padLeft(space);
}
 
Example #7
Source File: UIUtils.java    From uracer-kotd with Apache License 2.0 4 votes vote down vote up
public static CheckBox newCheckBox (String text, boolean checked) {
	return newCheckBox(text, checked, null);
}
 
Example #8
Source File: Scene2dUtils.java    From gdx-soundboard with MIT License 3 votes vote down vote up
public static CheckBox addCheckBox(String labelText, Table parent, Skin skin){

        CheckBox info = new CheckBox(labelText, skin);
        parent.add(info).right().fillX().expandX().row();

        return info;
    }
 
Example #9
Source File: MainMenuInterface.java    From buffer_bci with GNU General Public License v3.0 3 votes vote down vote up
private void createStageActors() {
	faster = new CheckBox(LABEL_FASTER, skin);

	color = new CheckBox(LABEL_COLOR, skin);

	animate = new CheckBox(LABEL_ANIMATE, skin);

	sound = new CheckBox(LABEL_SOUND, skin);
	table.setPosition(210, 30);

	outline = new CheckBox(LABEL_OUTLINE, skin);

	permOutline = new CheckBox(LABEL_PERM_OUTLINE, skin);

	fasterLabel = new Label(LABEL_FASTER_SELECT, skin);
	fasterLabel.setPosition(240 - fasterLabel.getWidth() / 2, 115);

	fasterSlider = new Slider(0, 5, 1, false, skin);
	fasterSlider.setWidth(outline.getWidth());
	fasterSlider.setPosition(240 - fasterSlider.getWidth() / 2, 100);

	levelLabel = new Label(LABEL_LEVEL_SELECT, skin);
	levelLabel.setPosition(240 - levelLabel.getWidth() / 2, 85);

	levelSlider = new Slider(0, 5, 1, false, skin);
	levelSlider.setWidth(outline.getWidth());
	levelSlider.setPosition(240 - levelSlider.getWidth() / 2, 70);

	start = new TextButton("Start", skin);
	start.setPosition(210, 36);

	license = new TextButton("License", skin);
	license.setPosition(205, 2);

	fasterLabel.setY(215);
	fasterSlider.setY(200);

	levelLabel.setY(185);
	levelSlider.setY(170);
}