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

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


  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

        /**
         * Encodes a transparent KML LabelStyle
         */
        protected void setDefaultLabelStyle(Style style) {
            LabelStyle ls = style.createAndSetLabelStyle();
            ls.setColor("00ffffff");
        }
View Full Code Here

            LabelStyle ls = style.createAndSetLabelStyle();
            ls.setColor("00ffffff");
        }

        protected void setLabelStyle(Style style, SimpleFeature feature, TextSymbolizer symbolizer) {
            LabelStyle ls = style.createAndSetLabelStyle();
            double scale = 1;
            Font font = symbolizer.getFont();
            if(font != null && font.getSize() != null) {
                // we make the scale proportional to the normal font size
                double size = font.getSize().evaluate(feature, Double.class);
                scale = Math.round(size / Font.DEFAULT_FONTSIZE * 100) / 100.0;
            }
            ls.setScale(scale);

            Fill fill = symbolizer.getFill();
            if (fill != null) {
                Double opacity = fill.getOpacity().evaluate(feature, Double.class);
                if (opacity == null || Double.isNaN(opacity)) {
                    opacity = 1.0;
                }
                Color color = fill.getColor().evaluate(feature, Color.class);
                ls.setColor(colorToHex(color, opacity));
            } else {
                ls.setColor("ffffffff");
            }
        }
View Full Code Here

TOP

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

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.