程序包 org.bukkit.map

类 MapFont

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

public class MapFont extends Object
Represents a bitmap font drawable to a map.
  • 字段详细资料

    • 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 - The character to set the sprite for.
      sprite - The CharacterSprite to set.
      抛出:
      IllegalStateException - if this font is static.
    • getChar

      @Nullable public @Nullable MapFont.CharacterSprite getChar(char ch)
      Get the sprite for a given character.
      参数:
      ch - The character to get the sprite for.
      返回:
      The CharacterSprite associated with the character, or null if there is none.
    • getWidth

      public int getWidth(@NotNull @NotNull String text)
      Get the width of the given text as it would be rendered using this font.
      参数:
      text - The text.
      返回:
      The width in pixels.
    • getHeight

      public int getHeight()
      Get the height of this font.
      返回:
      The height of the font.
    • isValid

      public boolean isValid(@NotNull @NotNull String text)
      Check whether the given text is valid.
      参数:
      text - The text.
      返回:
      True if the string contains only defined characters, false otherwise.