Class FontIcon

java.lang.Object
de.gurkenlabs.litiengine.gui.FontIcon

public class FontIcon extends Object
Represents an icon rendered using a specific font and text.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FontIcon(Font font, char text)
    Constructs a FontIcon with the specified font and character.
    FontIcon(Font font, String unicode)
    Constructs a FontIcon with the specified font and unicode string.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the font used to render the icon.
    Returns the text or unicode character to be rendered as the icon.
    void
    render(Graphics2D g, Color color, float fontSize, double x, double y, boolean bold)
    Renders the icon using the specified graphics context, color, font size, and position.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FontIcon

      public FontIcon(Font font, char text)
      Constructs a FontIcon with the specified font and character.
      Parameters:
      font - the font used to render the icon
      text - the character to be rendered as the icon
    • FontIcon

      public FontIcon(Font font, String unicode)
      Constructs a FontIcon with the specified font and unicode string.
      Parameters:
      font - the font used to render the icon
      unicode - the unicode string to be rendered as the icon
  • Method Details

    • getFont

      public Font getFont()
      Returns the font used to render the icon.
      Returns:
      the font used to render the icon
    • getText

      public String getText()
      Returns the text or unicode character to be rendered as the icon.
      Returns:
      the text or unicode character to be rendered as the icon
    • render

      public void render(Graphics2D g, Color color, float fontSize, double x, double y, boolean bold)
      Renders the icon using the specified graphics context, color, font size, and position.
      Parameters:
      g - the graphics context to use for rendering
      color - the color to render the icon
      fontSize - the size of the font to render the icon
      x - the x-coordinate where the icon should be rendered
      y - the y-coordinate where the icon should be rendered
      bold - true if the font should be bold, false otherwise