Package com.badlogic.gdx.scenes.scene2d.ui

Examples of com.badlogic.gdx.scenes.scene2d.ui.Label


  static boolean drawDebug;

  public Actor wrap (TableLayout layout, Object object) {
    if (object instanceof String) {
      if (layout.skin == null) throw new IllegalStateException("Label cannot be created, no skin has been set.");
      return new Label((String)object, layout.skin);
    }
    if (object == null) {
      return new Actor() {
        {
          visible = false;
View Full Code Here


    fpsContainer.right();
  if (alignment.getValue().equals(Align.top))
    fpsContainer.top();
  else
    fpsContainer.bottom();
  fpsContainer.add(new Label("FPS: NaN", R2Assets.R2Skin));
  stage.addActor(fpsContainer);
  return stage;
  }
View Full Code Here

  public void create() {
  batch = new SpriteBatch();
  MASTER_STAGE = new Stage(new StretchViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
  Skin MASTERSKIN = new Skin(Gdx.files.internal("uiskin.json"));
  fps = new Label("FPS: ", MASTERSKIN);
  Table tmp = new Table();
  tmp.setFillParent(true);
  tmp.top().left();
  tmp.add(fps);
  MASTER_STAGE.addActor(tmp);
View Full Code Here

    private Slider slider (final String name, float defaultValue) {
      final Slider slider = new Slider(0, 1, 0.01f, false, skin);
      slider.setValue(prefs.getFloat(name, defaultValue));

      final Label label = new Label("", skin);
      label.setAlignment(Align.right);
      label.setText(Float.toString((int)(slider.getValue() * 100) / 100f));

      slider.addListener(new ChangeListener() {
        public void changed (ChangeEvent event, Actor actor) {
          label.setText(Float.toString((int)(slider.getValue() * 100) / 100f));
          if (!slider.isDragging()) {
            prefs.putFloat(name, slider.getValue());
            prefs.flush();
          }
        }
View Full Code Here

      return table;
    }

    void toast (String text) {
      Table table = new Table();
      table.add(new Label(text, skin));
      table.getColor().a = 0;
      table.pack();
      table.setPosition(-table.getWidth(), -3 - table.getHeight());
      table.addAction(sequence( //
        parallel(moveBy(0, table.getHeight(), 0.3f), fadeIn(0.3f)), //
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.scenes.scene2d.ui.Label

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.