程序包 org.bukkit.map

类 MapFont

java.lang.Object
org.bukkit.map.MapFont
直接已知子类:
MinecraftFont

public class MapFont extends Object
表示可在地图上绘制的位图字体。
  • 字段详细资料

    • malleable

      protected boolean malleable
  • 构造器详细资料

    • MapFont

      public MapFont()
  • 方法详细资料

    • setChar

      public void setChar(char ch, @NotNull @NotNull MapFont.CharacterSprite sprite)
      为给定字符设置精灵图。

      原文: Set the sprite for a given character.

      参数:
      ch - 要设置精灵图的字符。
      sprite - 要设置的CharacterSprite。
      抛出:
      IllegalStateException - 如果此字体是静态的。
    • getChar

      @Nullable public @Nullable MapFont.CharacterSprite getChar(char ch)
      获取给定字符的精灵图。

      原文: Get the sprite for a given character.

      参数:
      ch - 要获取精灵图的字符。
      返回:
      与该字符关联的CharacterSprite,如果没有则返回null。
    • getWidth

      public int getWidth(@NotNull @NotNull String text)
      获取使用此字体渲染给定文本时的宽度。

      原文: Get the width of the given text as it would be rendered using this font.

      参数:
      text - 文本。
      返回:
      宽度(像素)。
    • getHeight

      public int getHeight()
      获取此字体的高度。

      原文: Get the height of this font.

      返回:
      字体的高度。
    • isValid

      public boolean isValid(@NotNull @NotNull String text)
      检查给定文本是否有效。

      原文: Check whether the given text is valid.

      参数:
      text - 文本。
      返回:
      如果字符串仅包含已定义字符则返回true,否则返回false。