Package org.bukkit.map.MapFont

Examples of org.bukkit.map.MapFont.CharacterSprite


   */
  public static int getWidth(String... text) {
    int width = 0;
    for (String part : text) {
      char character;
      CharacterSprite charsprite;
      for (int i = 0; i < part.length(); i++) {
        character = part.charAt(i);
        if (character == '\n')
          continue;
        if (character == StringUtil.CHAT_STYLE_CHAR) {
          i++;
          continue;
        } else if (character == ' ') {
          width += SPACE_WIDTH;
        } else {
          charsprite = MinecraftFont.Font.getChar(character);
          if (charsprite != null) {
            width += charsprite.getWidth();
          }
        }
      }
    }
    return width;
View Full Code Here

TOP

Related Classes of org.bukkit.map.MapFont.CharacterSprite

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.