Direct Known Subclasses:
TextButtonPrefab

public class TextPrefab extends CanvasElementPrefab
Prefab for text elements in the UI.
  • Field Details

    • text

      protected String text
    • color

      protected Color color
    • font

      protected Font font
  • Constructor Details

    • TextPrefab

      public TextPrefab()
    • TextPrefab

      public TextPrefab(String text)
    • TextPrefab

      public TextPrefab(String text, Color color)
  • Method Details

    • setText

      public void setText(String text)
    • setColor

      public void setColor(Color color)
    • setFont

      public void setFont(String fontPath)
    • setFont

      public void setFont(Font font)
    • apply

      protected void apply(Entity entity)
      Description copied from class: Prefab
      Adds this prefab's predefined components to a given entity and copies values from this prefab.
      Overrides:
      apply in class CanvasElementPrefab