Package com.badlogic.gdx.utils

Examples of com.badlogic.gdx.utils.StringBuilder


    float oldScaleX = font.getScaleX();
    float oldScaleY = font.getScaleY();
    if (fontScaleX != 1 || fontScaleY != 1) font.setScale(fontScaleX, fontScaleY);

    float width = getWidth(), height = getHeight();
    StringBuilder text;
    if (ellipse && width < bounds.width) {
      float ellipseWidth = font.getBounds("...").width;
      text = tempText != null ? tempText : (tempText = new StringBuilder());
      text.setLength(0);
      if (width > ellipseWidth) {
        text.append(this.text, 0, font.computeVisibleGlyphs(this.text, 0, this.text.length, width - ellipseWidth));
        text.append("...");
      }
    } else
      text = this.text;

    Drawable background = style.background;
View Full Code Here


    @Override
    public String getResultAsString () {
      BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
      try {
        int approxStringLength = connection.getContentLength();
        StringBuilder b;
        if (approxStringLength > 0)
          b = new StringBuilder(approxStringLength);
        else
          b = new StringBuilder();
        String line;
        while ((line = reader.readLine()) != null)
          b.append(line);
        return b.toString();
      } catch (IOException e) {
        return "";
      } finally {
        StreamUtils.closeQuietly(reader);
      }
View Full Code Here

      assetManager.finishLoading();
      assetManager.setLoader(ParticleEffect.class, new ParticleEffectLoader(new AbsoluteFileHandleResolver()));
      assetManager.get(DEFAULT_MODEL_PARTICLE, Model.class).materials.get(0).set(new BlendingAttribute(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA, 1));
     
      //Ui
      stringBuilder = new StringBuilder();
      Skin skin = assetManager.get(DEFAULT_SKIN, Skin.class);
      ui = new Stage();
      fpsLabel = new Label("", skin);
      pointCountLabel = new Label("", skin);
      billboardCountLabel = new Label("", skin);
View Full Code Here

    return this;
  }
 
  @Override public String toString() {
    StringBuilder result = new StringBuilder();
    float radians = angle();
    result.append("radians: ");
    result.append(radians);
    result.append(", degrees: ");
    result.append(radians * MathUtils.radiansToDegrees);
    return result.toString();
  }
View Full Code Here

        invalidateHierarchy();
      }
    }

    float width = getWidth(), height = getHeight();
    StringBuilder text;
    if (ellipse && width < bounds.width) {
      float ellipseWidth = font.getBounds("...").width;
      text = tempText != null ? tempText : (tempText = new StringBuilder());
      text.setLength(0);
      if (width > ellipseWidth) {
        text.append(this.text, 0, font.computeVisibleGlyphs(this.text, 0, this.text.length, width - ellipseWidth));
        text.append("...");
      }
    } else
      text = this.text;

    Drawable background = style.background;
View Full Code Here

  }

  private void test (float... frames) {
    int eventCount = frames.length;

    StringBuilder buffer = new StringBuilder();
    for (int i = 0; i < eventCount; i++)
      buffer.append((char)('a' + i));

    this.events = buffer.toString().toCharArray();
    this.frames = frames;
    timeline = new EventTimeline(eventCount);

    float maxFrame = 0;
    int distinctCount = 0;
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.utils.StringBuilder

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.