Package pgui.txt

Class Text


public class Text extends Element
An object for displaying text within a Window.
  • Field Details

    • content

      public String content
      The actual text to be displayed.
    • x

      public float x
      The position of the text in its window.
    • y

      public float y
      The position of the text in its window.
  • Constructor Details

    • Text

      public Text(String t, float xpos, float ypos, int tsize, Window window)
      Parameters:
      t - The text to be displayed
      xpos - The position of the text in its window
      ypos - The position of the text in its window
      tsize - The text size
      window - The parent Window the Text belongs to
  • Method Details

    • display

      public void display(processing.core.PGraphics c)
      Description copied from class: Element
      Draws the object onto the canvas.
      Overrides:
      display in class Element
      Parameters:
      c - The PGraphics object (canvas) for which to draw to.
    • align

      public void align(int ax, int ay)
      Aligns the text using Processing's textAlign() method.
      Parameters:
      ax - LEFT, CENTER or RIGHT
      ay - TOP, CENTER or BOTTOM
      See Also:
      • PConstants
    • underline

      public void underline(float l)
      Underlines the text.
      Parameters:
      l - Length of underline
    • width

      public float width()
      Returns the width of the text on screen
      Returns:
      Text's width
      See Also: