Examples of computeVisibleGlyphs()


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

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    background.draw(batch, x, y, width, height);
    if (items.length > 0) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      int numGlyphs = font.computeVisibleGlyphs(items[selection], 0, items[selection].length(), availableWidth);
      bounds.set(font.getBounds(items[selection]));
      float textY = (int)(height / 2) + (int)(bounds.height / 2);
      font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
      font.draw(batch, items[selection], x + background.getLeftWidth(), y + textY, 0, numGlyphs);
    }
View Full Code Here

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

    background.draw(batch, x, y, width, height);
    T selected = this.selected != null ? this.selected : selection.first();
    if (selected != null) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      String string = selected.toString();
      int numGlyphs = font.computeVisibleGlyphs(string, 0, string.length(), availableWidth);
      bounds.set(font.getBounds(string));
      height -= background.getBottomHeight() + background.getTopHeight();
      float textY = (int)(height / 2 + background.getBottomHeight() + bounds.height / 2);
      font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
      font.draw(batch, string, x + background.getLeftWidth(), y + textY, 0, numGlyphs);
View Full Code Here

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

    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;
View Full Code Here

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

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    background.draw(batch, x, y, width, height);
    if (items.length > 0) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      int numGlyphs = font.computeVisibleGlyphs(items[selectedIndex], 0, items[selectedIndex].length(), availableWidth);
      bounds.set(font.getBounds(items[selectedIndex]));
      height -= background.getBottomHeight() + background.getTopHeight();
      float textY = (int)(height / 2 + background.getBottomHeight() + bounds.height / 2);
      font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
      font.draw(batch, items[selectedIndex], x + background.getLeftWidth(), y + textY, 0, numGlyphs);
View Full Code Here

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

    background.draw(batch, x, y, width, height);
    T selected = this.selected != null ? this.selected : selection.first();
    if (selected != null) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      String string = selected.toString();
      int numGlyphs = font.computeVisibleGlyphs(string, 0, string.length(), availableWidth);
      bounds.set(font.getBounds(string));
      height -= background.getBottomHeight() + background.getTopHeight();
      float textY = (int)(height / 2 + background.getBottomHeight() + bounds.height / 2);
      font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
      font.draw(batch, string, x + background.getLeftWidth(), y + textY, 0, numGlyphs);
View Full Code Here

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

    background.draw(batch, x, y, width, height);
    T selected = this.selected != null ? this.selected : selection.first();
    if (selected != null) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      String string = selected.toString();
      int numGlyphs = font.computeVisibleGlyphs(string, 0, string.length(), availableWidth);
      bounds.set(font.getBounds(string));
      height -= background.getBottomHeight() + background.getTopHeight();
      float textY = (int)(height / 2 + background.getBottomHeight() + bounds.height / 2);
      font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
      font.draw(batch, string, x + background.getLeftWidth(), y + textY, 0, numGlyphs);
View Full Code Here

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

    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;
View Full Code Here

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

    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    background.draw(batch, x, y, width, height);
    if (items.length > 0) {
      float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
      int numGlyphs = font.computeVisibleGlyphs(items[selection], 0, items[selection].length(), availableWidth);
      bounds.set(font.getBounds(items[selection]));
      float textY = (int)(height / 2) + (int)(bounds.height / 2);
      font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
      font.draw(batch, items[selection], x + background.getLeftWidth(), y + textY, 0, numGlyphs);
    }
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.