Interface DrawerText


public interface DrawerText
DrawerText Draws text
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    draw(String text, double x, double y, DrawColor color)
    Draw text
    double
    draw(String text, double x, double y, DrawColor color, boolean shadow)
    Draw text
    default double
    Get the height of the text without a shadow
    double
    getHeight(boolean shadow)
    Get the height of the text
    default double
    Get the width of the text without a shadow
    double
    getWidth(String text, boolean shadow)
    Get the width of the text
    void
    startDrawing(double size)
    Start drawing
    void
    startSizing(double size)
    Start sizing Lets you use the width and height methods, without rendering the text
    default void
    Stop drawing
    void
    stopDrawing(net.minecraft.client.gui.DrawContext context)
    Stop drawing
    void
    Stop sizing
  • Method Details

    • startDrawing

      void startDrawing(double size)
      Start drawing
      Parameters:
      size - size of the text
    • stopDrawing

      void stopDrawing(net.minecraft.client.gui.DrawContext context)
      Stop drawing
      Parameters:
      context - DrawContext to use for rendering, can be null
    • stopDrawing

      default void stopDrawing()
      Stop drawing
    • draw

      double draw(String text, double x, double y, DrawColor color, boolean shadow)
      Draw text
      Parameters:
      text - text to render
      x - x position
      y - y position
      color - color of the text
      shadow - if the text should have a shadow
      Returns:
      the width of the text
    • draw

      default double draw(String text, double x, double y, DrawColor color)
      Draw text
      Parameters:
      text - text to render
      x - x position
      y - y position
      color - color of the text
      Returns:
      the width of the text
    • startSizing

      void startSizing(double size)
      Start sizing Lets you use the width and height methods, without rendering the text
      Parameters:
      size - size of the text
    • stopSizing

      void stopSizing()
      Stop sizing
    • getWidth

      double getWidth(String text, boolean shadow)
      Get the width of the text
      Parameters:
      text - text to get the width of
      shadow - if the text has a shadow
      Returns:
      the width of the text
    • getWidth

      default double getWidth(String text)
      Get the width of the text without a shadow
      Parameters:
      text - text to get the width of
      Returns:
      the width of the text
    • getHeight

      double getHeight(boolean shadow)
      Get the height of the text
      Parameters:
      shadow - if the text has a shadow
      Returns:
      the height of the text
    • getHeight

      default double getHeight()
      Get the height of the text without a shadow
      Returns:
      the height of the text