Examples of computeGlyphAdvancesAndPositions()


Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

              }
            }
            content = builder.toString();
            text = text.substring(0, cursor) + content + text.substring(cursor, text.length());
            cursor += content.length();
            font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
          }
        }
        if (keycode == Keys.C) {
          if (hasSelection) {
            int minIndex = Math.min(cursor, selectionStart);
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

    if (parent.keyboardFocusedActor == this) {
      if (character == 8 && (cursor > 0 || hasSelection)) {
        if (!hasSelection) {
          text = text.substring(0, cursor - 1) + text.substring(cursor);
          cursor--;
          font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
        } else {
          int minIndex = Math.min(cursor, selectionStart);
          int maxIndex = Math.max(cursor, selectionStart);

          text = (minIndex > 0 ? text.substring(0, minIndex) : "")
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

          int maxIndex = Math.max(cursor, selectionStart);

          text = (minIndex > 0 ? text.substring(0, minIndex) : "")
            + (maxIndex < text.length() ? text.substring(maxIndex, text.length()) : "");
          cursor = minIndex;
          font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
          hasSelection = false;
        }
      }
      if (character == 127 && (cursor < text.length() || hasSelection)) {
        if (!hasSelection) {
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

        }
      }
      if (character == 127 && (cursor < text.length() || hasSelection)) {
        if (!hasSelection) {
          text = text.substring(0, cursor) + text.substring(cursor + 1);
          font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
        } else {
          int minIndex = Math.min(cursor, selectionStart);
          int maxIndex = Math.max(cursor, selectionStart);

          text = (minIndex > 0 ? text.substring(0, minIndex) : "")
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

          int maxIndex = Math.max(cursor, selectionStart);

          text = (minIndex > 0 ? text.substring(0, minIndex) : "")
            + (maxIndex < text.length() ? text.substring(maxIndex, text.length()) : "");
          cursor = minIndex;
          font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
          hasSelection = false;
        }
      }
      if (font.containsCharacter(character)) {
        if (!hasSelection) {
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

      }
      if (font.containsCharacter(character)) {
        if (!hasSelection) {
          text = text.substring(0, cursor) + character + text.substring(cursor, text.length());
          cursor++;
          font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
        } else {
          int minIndex = Math.min(cursor, selectionStart);
          int maxIndex = Math.max(cursor, selectionStart);

          text = (minIndex > 0 ? text.substring(0, minIndex) : "")
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

          text = (minIndex > 0 ? text.substring(0, minIndex) : "")
            + (maxIndex < text.length() ? text.substring(maxIndex, text.length()) : "");
          cursor = minIndex;
          text = text.substring(0, cursor) + character + text.substring(cursor, text.length());
          cursor++;
          font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
          hasSelection = false;
        }
      }
      if (listener != null) listener.keyTyped(this, character);
      return true;
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

    BitmapFont font = style.font;

    this.text = text;
    this.cursor = 0;
    this.hasSelection = false;
    font.computeGlyphAdvancesAndPositions(text, this.glyphAdvances, this.glyphPositions);

    textBounds.set(font.getBounds(text));
    textBounds.height -= font.getDescent() * 2;
    font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

    this.hasSelection = false;
    font.computeGlyphAdvancesAndPositions(text, this.glyphAdvances, this.glyphPositions);

    textBounds.set(font.getBounds(text));
    textBounds.height -= font.getDescent() * 2;
    font.computeGlyphAdvancesAndPositions(text, glyphAdvances, glyphPositions);
  }

  /** @return the text of this text field. Never null, might be an empty string. */
  public String getText () {
    return text;
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.computeGlyphAdvancesAndPositions()

    cursor = 0;
    clearSelection();

    textBounds.set(font.getBounds(displayText));
    textBounds.height -= font.getDescent() * 2;
    font.computeGlyphAdvancesAndPositions(displayText, glyphAdvances, glyphPositions);
  }

  /** @return Never null, might be an empty string. */
  public String getText () {
    return text;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.