Java Code Examples for com.badlogic.gdx.scenes.scene2d.ui.Label#clearActions()

The following examples show how to use com.badlogic.gdx.scenes.scene2d.ui.Label#clearActions() . 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 File: StringSpin.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
public void setTextImmediately(String text) {
    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();
        Label label = labels.get(i);
        label.clearActions();
        label.setY(-(letters.length() - idx - 1) * lineHeight);
    }
}
 
Example 2
Source File: StringSpin.java    From dice-heroes with 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);
    }
}