Package com.badlogic.gdx.graphics.g2d.BitmapFont

Examples of com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds


    setText(text);
  }

  public void setText (String text) {
    this.text = text;
    TextBounds bounds = style.font.getMultiLineBounds(text);
    cache.setMultiLineText(text, 0, bounds.height);
    prefWidth = bounds.width;
    prefHeight = bounds.height - style.font.getDescent() * 2;
  }
 
View Full Code Here


    prefWidth = 0;
    prefHeight = 0;

    for (int i = 0; i < items.length; i++) {
      String item = items[i];
      TextBounds bounds = font.getBounds(item);
      prefWidth = Math.max(bounds.width, prefWidth);
    }

    itemHeight = font.getCapHeight() - font.getDescent() * 2;
    itemHeight += selectedPatch.getTopHeight() + selectedPatch.getBottomHeight();
View Full Code Here

      float prefWidth = 0;
      float prefHeight = 0;

      for (int i = 0; i < items.length; i++) {
        String item = items[i];
        TextBounds bounds = font.getBounds(item);
        prefWidth = Math.max(bounds.width, prefWidth);

      }

      itemHeight = font.getCapHeight() + -font.getDescent() * 2;
 
View Full Code Here

    textOffsetX = selectedDrawable.getLeftWidth();
    textOffsetY = selectedDrawable.getTopHeight() - font.getDescent();

    prefWidth = 0;
    for (int i = 0; i < items.length; i++) {
      TextBounds bounds = font.getBounds(items[i]);
      prefWidth = Math.max(bounds.width, prefWidth);
    }
    prefWidth += selectedDrawable.getLeftWidth() + selectedDrawable.getRightWidth();
    prefHeight = items.length * itemHeight;

 
View Full Code Here

    buttonTable.draw(batch, parentAlpha);
    buttonTable.translate(-x, -y);

    // Draw the title without the batch transformed or clipping applied.
    y += height;
    TextBounds bounds = titleCache.getBounds();
    if ((titleAlignment & Align.left) != 0)
      x += getPadLeft();
    else if ((titleAlignment & Align.right) != 0)
      x += width - bounds.width - getPadRight();
    else
View Full Code Here

    textOffsetX = selectedDrawable.getLeftWidth();
    textOffsetY = selectedDrawable.getTopHeight() - font.getDescent();

    prefWidth = 0;
    for (int i = 0; i < items.size; i++) {
      TextBounds bounds = font.getBounds(items.get(i).toString());
      prefWidth = Math.max(bounds.width, prefWidth);
    }
    prefWidth += selectedDrawable.getLeftWidth() + selectedDrawable.getRightWidth();
    prefHeight = items.size * itemHeight;

 
View Full Code Here

    buttonTable.setPosition(width - buttonTable.getWidth(), Math.min(height - padTop, height - buttonTable.getHeight()));
    buttonTable.draw(batch, parentAlpha);

    // Draw the title without the batch transformed or clipping applied.
    y += height;
    TextBounds bounds = titleCache.getBounds();
    if ((titleAlignment & Align.left) != 0)
      x += getPadLeft();
    else if ((titleAlignment & Align.right) != 0)
      x += width - bounds.width - getPadRight();
    else
View Full Code Here

    textOffsetX = selectedPatch.getLeftWidth();
    textOffsetY = selectedPatch.getTopHeight() - font.getDescent();

    prefWidth = 0;
    for (int i = 0; i < items.length; i++) {
      TextBounds bounds = font.getBounds(items[i]);
      prefWidth = Math.max(bounds.width, prefWidth);
    }
    prefHeight = items.length * itemHeight;

    invalidateHierarchy();
 
View Full Code Here

    return getTableLayout().getToolkit().height(getTableLayout(), getPadTop());
  }

  public void layout () {
    super.layout();
    TextBounds bounds = style.titleFont.getMultiLineBounds(title);
    titleCache.setMultiLineText(title, width / 2 - bounds.width / 2, height - getTitleBarHeight() / 2 + bounds.height / 2);
  }
View Full Code Here

      float prefWidth = 0;
      float prefHeight = 0;

      for (int i = 0; i < items.length; i++) {
        String item = items[i];
        TextBounds bounds = font.getBounds(item);
        prefWidth = Math.max(bounds.width, prefWidth);
      }

      itemHeight = font.getCapHeight() + -font.getDescent() * 2 + style.itemSpacing;
      itemHeight += listSelection.getTopHeight() + listSelection.getBottomHeight();
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds

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.