Java Code Examples for com.badlogic.gdx.scenes.scene2d.ui.Label

The following examples show how to use com.badlogic.gdx.scenes.scene2d.ui.Label. These examples are extracted from open source projects. 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 Project: talos   Source File: SelectBoxWidget.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Actor getSubWidget() {
    selectBox = new SelectBox<>(TalosMain.Instance().UIStage().getSkin(), "propertyValue");
    noValueLabel = new Label("", TalosMain.Instance().UIStage().getSkin());
    noValueLabel.setAlignment(Align.right);
    stack = new Stack();
    stack.add(noValueLabel);
    stack.add(selectBox);

    noValueLabel.setVisible(false);

    listener = new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            String newValue = selectBox.getSelected();
            valueChanged(newValue);
        }
    };
    selectBox.addListener(listener);

    return stack;
}
 
Example 2
Source Project: talos   Source File: ModuleListPopup.java    License: Apache License 2.0 6 votes vote down vote up
private void parseCategory(FilteredTree<String> tree, FilteredTree.Node parent, XmlReader.Element element) {
    Array<XmlReader.Element> categories = element.getChildrenByName("category");
    for(XmlReader.Element category: categories) {
        FilteredTree.Node categoryNode = new FilteredTree.Node(category.getAttribute("name"), new Label(category.getAttribute("name"), getSkin()));

        if(parent != null) parent.add(categoryNode);
        else tree.add(categoryNode);

        parseCategory(tree, categoryNode, category);
    }

    // get modules
    Array<XmlReader.Element> modules = element.getChildrenByName("module");
    for(XmlReader.Element module: modules) {
        FilteredTree.Node node = new FilteredTree.Node(module.getAttribute("name"), new Label(module.getAttribute("name"), getSkin()));
        nameToModuleClass.put(module.getAttribute("name"), module.getText());

        registerModule(module);

        if(parent != null) parent.add(node);
        else tree.add(node);
    }
}
 
Example 3
Source Project: talos   Source File: VectorFieldModuleWrapper.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void configureSlots () {
    addInputSlot("field position", VectorFieldModule.POSITION);
    addInputSlot("field size", VectorFieldModule.SIZE_SCALE);
    addInputSlot("field force", VectorFieldModule.FORCE_SCALE);

    addOutputSlot("velocity", VectorFieldModule.VELOCITY);
    addOutputSlot("angle", VectorFieldModule.ANGLE);

    leftWrapper.add().expandY().row();
    rightWrapper.add().expandY().row();

    vectorFieldLabel = new Label("drop .fga file here", getSkin());
    vectorFieldLabel.setAlignment(Align.center);
    vectorFieldLabel.setWrap(true);
    contentWrapper.add(vectorFieldLabel).padTop(60f).padBottom(10f).size(180, 50).center().expand();
}
 
Example 4
Source Project: ingress-apk-mod   Source File: Entry.java    License: Apache License 2.0 6 votes vote down vote up
public static void PortalInfoDialog_onStatsTableCreated(PortalInfoDialog dialog, Table t) {
    Mod.portalInfoDialog = dialog;

    Label.LabelStyle style = Mod.skin.get("portal-stats", Label.LabelStyle.class);

    List<Cell> cells = new ArrayList<Cell>(t.getCells());
    t.clear();
    t.add((Actor) cells.get(0).getWidget()).left();
    t.add((Actor) cells.get(1).getWidget()).left().expandX();
    t.row();
    t.add((Actor) cells.get(3).getWidget()).left();
    t.add((Actor) cells.get(4).getWidget()).left().expandX();
    t.row();
    t.add(new Label("Keys:", style)).left();
    t.add(new Label(String.valueOf(InventoryUtils.getNumberOfPortalKeys(dialog.portalComponent)), style)).left().expandX();
    t.row();
    t.add(new Label("Dist.:", style)).left();
    t.add(portalInfoDistLabel = new Label("", style)).left().expandX();
}
 
Example 5
Source Project: xibalba   Source File: HudRenderer.java    License: MIT License 6 votes vote down vote up
private void updateEnemyInfo() {
  if (playerDetails.lastHitEntity == null) {
    enemyInfo.clear();
  } else {
    AttributesComponent enemyAttributes
        = ComponentMappers.attributes.get(playerDetails.lastHitEntity);
    String name = enemyAttributes.name;

    if (enemyInfo.getChildren().size == 0) {
      enemyInfo.addActor(new Label(name, Main.skin));
      enemyInfo.addActor(new Label(createEntityHealth(playerDetails.lastHitEntity), Main.skin));
      enemyInfo.addActor(new Label(createEntityOxygen(playerDetails.lastHitEntity), Main.skin));
      enemyInfo.addActor(new Label(createEntityStatus(playerDetails.lastHitEntity), Main.skin));
    } else {
      Label enemyNameLabel = (Label) enemyInfo.getChildren().get(0);
      enemyNameLabel.setText(name);
      Label enemyHealthLabel = (Label) enemyInfo.getChildren().get(1);
      enemyHealthLabel.setText(createEntityHealth(playerDetails.lastHitEntity));
      Label enemyOxygenLabel = (Label) enemyInfo.getChildren().get(2);
      enemyOxygenLabel.setText(createEntityOxygen(playerDetails.lastHitEntity));
      Label enemyStatusLabel = (Label) enemyInfo.getChildren().get(3);
      enemyStatusLabel.setText(createEntityStatus(playerDetails.lastHitEntity));
    }
  }
}
 
Example 6
Source Project: Cubes   Source File: MultiplayerConnectMenu.java    License: MIT License 6 votes vote down vote up
public MultiplayerConnectMenu() {
  super();
  title = new Label(Localization.get("menu.multiplayer.title"), skin.get("title", Label.LabelStyle.class));
  address = new TextField("", skin);
  address.setMessageText(Localization.get("menu.multiplayer.address"));
  port = new TextField("", skin);
  port.setMessageText(Localization.get("menu.multiplayer.port", 24842)); //Not "Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)" because the port is set on the server
  port.setTextFieldFilter(new TextField.TextFieldFilter.DigitsOnlyFilter());
  connect = new TextButton(Localization.get("menu.multiplayer.connect"), skin);
  back = MenuTools.getBackButton(this);

  connect.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      Adapter.setMenu(new MultiplayerLoadingMenu(address.getText().isEmpty() ? "localhost" : address.getText(), port.getText().isEmpty() ? 24842 : Integer.parseInt(port.getText())));
    }
  });

  stage.addActor(title);
  stage.addActor(address);
  stage.addActor(port);
  stage.addActor(connect);
  stage.addActor(back);
}
 
Example 7
Source Project: xibalba   Source File: YouScreen.java    License: MIT License 6 votes vote down vote up
private void updateDefectsGroup() {
  defectsGroup.clear();

  defectsGroup.addActor(new Label("Defects", Main.skin));
  defectsGroup.addActor(new Label("", Main.skin));

  Label instructions = new Label(
      WordUtils.wrap(
          "[DARK_GRAY]Taking a major defect gives you 2 points, taking a minor gives you 1", 70
      ), Main.skin
  );

  defectsGroup.addActor(instructions);
  defectsGroup.addActor(new Label("", Main.skin));

  for (int i = 0; i < this.defects.size(); i++) {
    DefectData defectData = this.defects.get(i);

    defectsGroup.addActor(
        new Label(createDefectText(i, defectData), Main.skin)
    );
  }
}
 
Example 8
Source Project: xibalba   Source File: GodScreen.java    License: MIT License 6 votes vote down vote up
private void updateGodsGroup() {
  godsGroup.clear();

  godsGroup.addActor(new Label("Gods", Main.skin));
  godsGroup.addActor(new Label("", Main.skin));

  for (int i = 0; i < godDataList.size(); i++) {
    GodData godData = godDataList.get(i);

    String string;

    if (i == godSelected) {
      string = "[DARK_GRAY]> [WHITE]" + godData.name + "\n[DARK_GRAY]" + godData.description;
    } else {
      string = "[LIGHT_GRAY]" + godData.name + "\n[DARK_GRAY]" + godData.description;
    }

    godsGroup.addActor(new Label(string, Main.skin));
  }
}
 
Example 9
Source Project: bladecoder-adventure-engine   Source File: Message.java    License: Apache License 2.0 6 votes vote down vote up
public static void init(Skin skin) {
	msg = new Label("", skin, "message") {

		@Override
		public Actor hit(float x, float y, boolean touchable) {
			if (isModal)
				return this;

			return null;
		}
	};

	Message.skin = skin;
	msg.setWrap(true);
	msg.setAlignment(Align.center, Align.center);
}
 
Example 10
Source Project: xibalba   Source File: CharacterScreen.java    License: MIT License 6 votes vote down vote up
private void updateSkillsGroup() {
  skillsGroup.clear();

  skillsGroup.addActor(new Label("Skills", Main.skin));
  skillsGroup.addActor(new Label("", Main.skin));

  for (Map.Entry<String, Integer> entry : skills.levels.entrySet()) {
    String skill = entry.getKey();
    Integer level = entry.getValue();

    if (level > 0) {
      String name = WordUtils.capitalize(skill);

      skillsGroup.addActor(new Label(
          "[LIGHT_GRAY]" + name + " [WHITE]" + level + "[DARK_GRAY]d", Main.skin
      ));
    }
  }
}
 
Example 11
Source Project: xibalba   Source File: CharacterScreen.java    License: MIT License 6 votes vote down vote up
private void updateEquipmentGroup() {
  equipmentGroup.clear();

  equipmentGroup.addActor(new Label("Equipment", Main.skin));
  equipmentGroup.addActor(new Label("", Main.skin));

  int index = 0;

  for (java.util.Map.Entry<String, Entity> slot : equipment.slots.entrySet()) {
    String key = WordUtils.capitalize(slot.getKey());
    Entity item = slot.getValue();

    if (!WorldManager.entityHelpers.hasDefect(player, "One arm")
        || !Objects.equals(slot.getKey(), "left hand")) {
      equipmentGroup.addActor(
          new Label(createEquipmentSlotText(index, key, item), Main.skin)
      );
    }

    index++;
  }
}
 
Example 12
Source Project: dice-heroes   Source File: LanguageSelector.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void show(String language) {
    idx = -1;
    int i = 0;
    for (String lang : languages) {
        if (lang.equals(language)) {
            idx = i;
            break;
        }
        i++;
    }
    if (idx == -1) {
        language = "en";
        idx = 0;
    }
    left.setDisabled(idx == 0);
    right.setDisabled(idx == languages.length - 1);
    Label target = languageToLabel.get(language);
    languagePane.scrollTo(target.getX(), target.getY(), target.getWidth(), target.getHeight());
    languagePane.updateVisualScroll();
}
 
Example 13
Source Project: dice-heroes   Source File: ScaleSelector.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void show(int scale) {
    idx = -1;
    int i = 0;
    for (int s : scales) {
        if (s == scale) {
            idx = i;
            break;
        }
        i++;
    }
    if (idx == -1) {
        scale = min;
        idx = 0;
    }
    left.setDisabled(idx == 0);
    right.setDisabled(idx == scales.length - 1);
    Label target = scaleToLabel.get(scale);
    scalePane.scrollTo(target.getX(), target.getY(), target.getWidth(), target.getHeight());
    scalePane.updateVisualScroll();
}
 
Example 14
Source Project: gdx-soundboard   Source File: AddStateDialog.java    License: MIT License 6 votes vote down vote up
public AddStateDialog(final Stage stage, final Skin skin, final MusicEventManager eventManager) {

        super("Add State", skin);
        this.stage = stage;
        this.skin = skin;
        this.eventManager = eventManager;


        Table content = this.getContentTable();
        Label label = new Label("State name", skin);
        label.setAlignment(Align.left);
        content.add(label).left().fillX().expandX().row();

        eventName = new TextField("", skin);
        content.add(eventName).right().fillX().expandX().row();

        Table buttons = this.getButtonTable();
        buttons.defaults().fillX().expandX();
        
        this.button("Ok", true);
        this.button("Cancel", false);
        

        key(Keys.ENTER, true);
        key(Keys.ESCAPE, false);
    }
 
Example 15
public AbilityIconCounter(Ability ability, int value) {
    if (ability == null) {
        ability = Config.abilities.get("skip-turn");
    }
    image = new Image(Config.skin.getDrawable("ability/" + ability.name + "-icon"));
    if (ability.cost <0) image.setColor(AbilityIcon.unique);
    image.setScaling(Scaling.none);
    image.setAlign(Align.left | Align.top);
    image.moveBy(0, 1);

    counter = new Label("", Config.skin, "default", "inventory-counter");
    counter.setAlignment(Align.right | Align.bottom);
    setCount(value);

    addActor(image);
    addActor(counter);

    setSize(image.getPrefWidth(), image.getPrefHeight());
}
 
Example 16
Source Project: Klooni1010   Source File: Band.java    License: GNU General Public License v3.0 6 votes vote down vote up
public Band(final Klooni game, final GameLayout layout, final BaseScorer scorer) {
    this.scorer = scorer;
    bandTexture = Theme.getBlankTexture();

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = game.skin.getFont("font");

    scoreLabel = new Label("", labelStyle);
    scoreLabel.setAlignment(Align.center);
    infoLabel = new Label("pause menu", labelStyle);
    infoLabel.setAlignment(Align.center);

    scoreBounds = new Rectangle();
    infoBounds = new Rectangle();
    layout.update(this);
}
 
Example 17
Source Project: gdx-ai   Source File: SteeringTestBase.java    License: Apache License 2.0 6 votes vote down vote up
protected void addMaxLinearSpeedController (Table table, final Limiter limiter, float minValue, float maxValue, float step) {
	final Label labelMaxSpeed = new Label("Max.Lin.Speed [" + limiter.getMaxLinearSpeed() + "]", container.skin);
	table.add(labelMaxSpeed);
	table.row();
	Slider maxSpeed = new Slider(minValue, maxValue, step, false, container.skin);
	maxSpeed.setValue(limiter.getMaxLinearSpeed());
	maxSpeed.addListener(new ChangeListener() {
		@Override
		public void changed (ChangeEvent event, Actor actor) {
			Slider slider = (Slider)actor;
			limiter.setMaxLinearSpeed(slider.getValue());
			labelMaxSpeed.setText("Max.Lin.Speed [" + limiter.getMaxLinearSpeed() + "]");
		}
	});
	table.add(maxSpeed);
}
 
Example 18
Source Project: flopsydroid   Source File: FlopsyScreen.java    License: Apache License 2.0 6 votes vote down vote up
public FlopsyScreen(FlopsyDroidGame game, OnGlobalListener listener) {
    mStage = new Stage();

    mGlobalListener = listener;

    game.getAssetManager().load("flopsy.sprites", TextureAtlas.class);
    game.getAssetManager().finishLoading();
    mTextureAtlas = game.getAssetManager().get("flopsy.sprites", TextureAtlas.class);

    mLabelStyle = new Label.LabelStyle();
    mLabelStyle.font = new BitmapFont(Gdx.files.internal("flappyfont.fnt"),
            Gdx.files.internal("flappyfont.png"), false);

    mStage.addListener(new EventListener() {
        @Override
        public boolean handle(Event event) {

            if(event.getTarget().equals(mAndy)) {
                mGround.onDroidCollision();
                return true;
            }

            return false;
        }
    });
}
 
Example 19
Source Project: Unlucky   Source File: SMoveTooltip.java    License: MIT License 6 votes vote down vote up
public SMoveTooltip(Skin skin, Label.LabelStyle ls) {
    super("", skin);
    this.ls = ls;

    desc = new Label("", skin);
    desc.setFontScale(0.5f);
    this.getTitleLabel().setFontScale(0.5f);
    left();
    // fix padding because of scaling
    this.padTop(12);
    this.padLeft(2);
    this.padBottom(4);
    add(desc);
    pack();
    this.setTouchable(Touchable.disabled);
    this.setVisible(false);
    this.setMovable(false);
    this.setOrigin(Align.bottomLeft);
}
 
Example 20
Source Project: riiablo   Source File: SystemProfilerGUI.java    License: 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 21
Source Project: Cubes   Source File: SingleplayerSaveDeleteMenu.java    License: MIT License 6 votes vote down vote up
public SingleplayerSaveDeleteMenu(final Save save) {
  title = new Label(Localization.get("menu.singleplayer.delete.title"), skin.get("title", Label.LabelStyle.class));
  text = new Label(Localization.get("menu.singleplayer.delete.text", save.name), skin);
  delete = new TextButton(Localization.get("menu.singleplayer.delete.delete", save.name), skin);
  back = MenuTools.getBackButton(this);

  text.setAlignment(Align.center);

  delete.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      ClientSaveManager.deleteSave(save);
      Menu prev = MenuManager.getPrevious(SingleplayerSaveDeleteMenu.this);
      if (!(prev instanceof SingleplayerSavesMenu)) return;
      ((SingleplayerSavesMenu) prev).updateSavesList();
      Adapter.setMenu(prev);
    }
  });

  stage.addActor(title);
  stage.addActor(text);
  stage.addActor(delete);
  stage.addActor(back);
}
 
Example 22
Source Project: dice-heroes   Source File: StringSpin.java    License: GNU General Public License v3.0 6 votes vote down vote up
public StringSpin(int length, int letterWidth, String initialText) {
    ThesaurusData data = Config.thesaurus.getData("alphabet");
    labels = new Array<Label>(length);
    letters = String.valueOf(shuffleArray((data.en + " " + data.ru).toCharArray())).toUpperCase();
    Array<String> arr = new Array<String>(letters.length());
    arr.addAll(letters.split(""));

    String newLined = arr.toString("\n");
    String doubled = newLined + "\n" + newLined;
    Label.LabelStyle style = Config.skin.get("default", Label.LabelStyle.class);

    lineHeight = style.font.getLineHeight();

    for (int i = 0; i < length; i++) {
        addColumn(i, letterWidth, doubled);
    }
    setSize(letterWidth * length, lineHeight);
    setTextImmediately(initialText);
}
 
Example 23
Source Project: bladecoder-adventure-engine   Source File: VerbUI.java    License: Apache License 2.0 6 votes vote down vote up
public VerbUI(SceneScreen scn) {
	super(scn.getUI().getSkin());

	style = scn.getUI().getSkin().get(VerbUIStyle.class);

	if (style.background != null)
		setBackground(style.background);

	this.sceneScreen = scn;

	infoLine = new Label(VERBS_DESC.get(VERBS.indexOf(DEFAULT_VERB)), style.infoLineLabelStyle);
	infoLine.setAlignment(Align.center);
	add(infoLine).colspan(3).fillX().expandX();
	row();

	Table verbs = createVerbPanel();
	add(verbs).fill().expand();

	arrowPanel = createArrowPanel();
	add(arrowPanel).fillY().expandY();

	invPanel = createInventoryPanel();
	add(invPanel).fill().expand();
}
 
Example 24
Source Project: dice-heroes   Source File: DropVisualizer.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override public IFuture<Void> visualize(DroppedItem drop) {
    final Future<Void> future = new Future<Void>();

    Group group = new Group();
    Tile image = new Tile("item/" + drop.item.name);
    Label counter = new Label(String.valueOf(drop.count), Config.skin);
    counter.setSize(image.getWidth(), image.getHeight());
    counter.setAlignment(Align.right | Align.bottom);
    group.addActor(image);
    group.addActor(counter);
    group.setTransform(false);
    visualizer.viewController.notificationLayer.addActor(group);
    group.setPosition(drop.target.getX() * ViewController.CELL_SIZE, drop.target.getY() * ViewController.CELL_SIZE);
    group.addAction(Actions.parallel(
        Actions.moveBy(0, 30, 1f, Interpolation.fade),
        Actions.alpha(0, 1f, Interpolation.fade),
        Actions.delay(0.4f, Actions.run(new Runnable() {
            @Override public void run() {
                future.happen();
            }
        }))
    ));
    return future;
}
 
Example 25
@Override protected void initialize() {
    Table table = new Table(Config.skin);
    table.setBackground(Config.skin.getDrawable("ui-tutorial-window-background"));

    label = new LocLabel("", DieMessageWindow.ACTIVE);
    label.setWrap(true);
    label.setAlignment(Align.center);

    table.setTouchable(Touchable.disabled);

    Label tapToContinue = new LocLabel("tap-to-continue", DieMessageWindow.INACTIVE);
    tapToContinue.setWrap(true);
    tapToContinue.setAlignment(Align.center);

    if (image != null) {
        image.setTouchable(Touchable.disabled);
        table.add(image).padTop(-15 - dy).row();
    }
    final Cell<LocLabel> cell = table.add(label).width(100);
    if (forceLabelHeight) cell.height(labelHeight);
    cell.row();
    table.add(new Image(Config.skin, "ui-tutorial-window-line")).padTop(4).row();
    table.add(tapToContinue).width(80).row();

    this.table.add(table);
}
 
Example 26
Source Project: dice-heroes   Source File: DieMessageWindow.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override protected void initialize() {
    Table table = new Table(Config.skin);
    table.setBackground(Config.skin.getDrawable("ui-tutorial-window-background"));
    label = new LocLabel("", ACTIVE);
    label.setWrap(true);
    label.setAlignment(Align.center);

    table.setTouchable(Touchable.disabled);

    Label tapToContinue = new LocLabel("tap-to-continue", INACTIVE);
    tapToContinue.setWrap(true);
    tapToContinue.setAlignment(Align.center);

    table.add(imageTable).padTop(6).row();
    table.add(label).width(100).row();
    table.add(new Image(Config.skin, "ui-tutorial-window-line")).padTop(4).row();
    table.add(tapToContinue).width(80).row();

    this.table.add(table);
}
 
Example 27
Source Project: dice-heroes   Source File: StringSpin.java    License: GNU General Public License v3.0 5 votes vote down vote up
private void setText(String text, final float speed, final float spinTime, float endTime, Runnable callback) {
    for (int i = 0; i < labels.size; i++) {
        String letter = i < text.length() ? String.valueOf(text.charAt(i)).toUpperCase() : " ";
        int idx = letters.indexOf(letter.toUpperCase());
        if (idx == -1) idx = letters.indexOf(" ");
        if (idx == -1) throw new IllegalStateException();
        final Label label = labels.get(i);
        label.clearActions();
        addActions(label, i, idx, speed, spinTime, endTime, callback);
    }
}
 
Example 28
Source Project: vis-ui   Source File: TestSplitPane.java    License: Apache License 2.0 5 votes vote down vote up
private void addNormalWidgets () {
	Skin skin = VisUI.getSkin();
	Label label = new Label("Lorem \nipsum \ndolor \nsit \namet", skin);
	Label label2 = new Label("Consectetur \nadipiscing \nelit", skin);

	VisTable table = new VisTable(true);
	VisTable table2 = new VisTable(true);

	table.add(label);
	table2.add(label2);

	SplitPane splitPane = new SplitPane(table, table2, false, skin);
	add(splitPane).fill().expand();
}
 
Example 29
Source Project: talos   Source File: PropertyWidget.java    License: Apache License 2.0 5 votes vote down vote up
protected void build(String name) {
	if(name != null) {
		propertyName = new Label(name + ":", TalosMain.Instance().getSkin());
		add(propertyName).left();
		propertyName.setAlignment(Align.left);
		valueContainer = new Table();
		add(valueContainer).right().expandX().minWidth(170);
		addToContainer(getSubWidget());
	} else {
		add(getSubWidget()).growX();
	}
}
 
Example 30
Source Project: talos   Source File: BvBWorkspace.java    License: Apache License 2.0 5 votes vote down vote up
BvBWorkspace(BvBAddon bvb) {
    setSkin(TalosMain.Instance().getSkin());
    this.bvb = bvb;
    setModeUI();

    topUI.setTransform(false);

    skeletonContainer = new SkeletonContainer(this);

    talosRenderer = new SpriteBatchParticleRenderer(null);

    renderer = new SkeletonRenderer();
    renderer.setPremultipliedAlpha(false); // PMA results in correct blending without outlines. (actually should be true, not sure why this ruins scene2d later, probably blend screwup, will check later)

    setCameraPos(0, 0);
    bgColor.set(0.1f, 0.1f, 0.1f, 1f);

    hintLabel = new Label("", TalosMain.Instance().getSkin());
    add(hintLabel).left().expandX().pad(5f);
    row();
    add().expand();
    row();

    clearListeners();
    addListeners();
    addPanListener();

    bvb.properties.showPanel(this);
    bvb.properties.showPanel(skeletonContainer);
}