Package rendering

Class TextArtist

java.lang.Object
rendering.Artist
rendering.TextArtist

public class TextArtist extends Artist
Rendering an object as a text of a specified color, size and font.
  • Constructor Details

    • TextArtist

      public TextArtist(GameObject go, String text, int size, Color textColor)
      Constructor to intitialize the TextArtist attributes
      Parameters:
      go - GameObject to be used for xy coordinate reference
      text - the text to draw
      size - point size to be used for font "Serif"
      textColor - color to draw the text with (foreground)
  • Method Details

    • getText

      public String getText()
    • setText

      public void setText(String s)
    • getTextWidth

      public double getTextWidth()
    • setTextWidth

      public void setTextWidth(double textWidth)
    • getTextHeight

      public double getTextHeight()
    • setTextHeight

      public void setTextHeight(double textHeight)
    • draw

      public void draw(Graphics2D g)
      Draw the text.
      Specified by:
      draw in class Artist
      Parameters:
      g - The Swing graphics context.