Example usage for com.badlogic.gdx.utils StringBuilder setLength

List of usage examples for com.badlogic.gdx.utils StringBuilder setLength

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils StringBuilder setLength.

Prototype

public void setLength(int newLength) 

Source Link

Document

Sets the current length to a new value.

Usage

From source file:com.badlogic.gdx.ai.tests.BehaviorTreeViewer.java

License:Apache License

private void updateStepLabel() {
    StringBuilder sb = stepLabel.getText();
    sb.setLength(LABEL_STEP.length());
    sb.append(step);//from w  ww.  ja  v a 2s . c  o  m
    stepLabel.invalidateHierarchy();
}

From source file:com.badlogic.gdx.ai.tests.utils.scene2d.FloatValueLabel.java

License:Apache License

@Override
public void act(float delta) {
    float newValue = getValue();
    if (oldValue != newValue) {
        oldValue = newValue;/* w w  w. j  a  va 2s  . co m*/
        StringBuilder sb = getText();
        sb.setLength(appendIndex);
        sb.append(oldValue);
        invalidateHierarchy();
    }
    super.act(delta);
}

From source file:com.badlogic.gdx.ai.tests.utils.scene2d.IntValueLabel.java

License:Apache License

@Override
public void act(float delta) {
    int newValue = getValue();
    if (oldValue != newValue) {
        oldValue = newValue;/*from  ww  w.ja  va2 s.  c  o m*/
        StringBuilder sb = getText();
        sb.setLength(appendIndex);
        sb.append(oldValue);
        invalidateHierarchy();
    }
    super.act(delta);
}

From source file:com.mygdx.game.ui.ObjectValueLabel.java

License:Apache License

@Override
public void act(float delta) {
    T newValue = getValue();/*ww  w. j  ava 2  s  .co m*/
    if (!oldValue.equals(newValue)) {
        copyValue(newValue, oldValue);
        StringBuilder sb = getText();
        sb.setLength(appendIndex);
        sb.append(oldValue);
        invalidateHierarchy();
    }
    super.act(delta);
}