java.lang.Object
fr.r1r0r0.deltaengine.model.sprites.Text
All Implemented Interfaces:
Sprite

public final class Text
extends java.lang.Object
implements Sprite
Text Sprite, used to display text
  • Field Summary

    Fields
    Modifier and Type Field Description
    private Color color  
    private java.lang.String font  
    private javafx.scene.text.Text jfxText  
    private int size  
  • Constructor Summary

    Constructors
    Constructor Description
    Text​(java.lang.String text)
    Instantiate Text Sprite, used to display text
  • Method Summary

    Modifier and Type Method Description
    javafx.scene.Node getNode()
    The Sprite object
    void resize​(double width, double height)
    resize the sprite to the following width and height
    void setColor​(Color color)
    set the color of the text to be displayed
    void setFont​(java.lang.String font)
    set the font of the text to be displayed
    void setSize​(int size)
    set the size of the text to be displayed
    void setText​(java.lang.String text)
    set the text to be displayed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface fr.r1r0r0.deltaengine.model.sprites.Sprite

    getLayout, getRotate, getScale, getSize, getZOrder, setLayout, setLayout, setRotate, setScale, setZOrder
  • Field Details

    • size

      private int size
    • font

      private java.lang.String font
    • color

      private Color color
    • jfxText

      private javafx.scene.text.Text jfxText
  • Constructor Details

    • Text

      public Text​(java.lang.String text)
      Instantiate Text Sprite, used to display text
      Parameters:
      text - to be displayed
  • Method Details

    • setText

      public void setText​(java.lang.String text)
      set the text to be displayed
      Parameters:
      text - the new text to be displayed
    • setSize

      public void setSize​(int size)
      set the size of the text to be displayed
      Parameters:
      size - the new size of the text
    • setFont

      public void setFont​(java.lang.String font)
      set the font of the text to be displayed
      Parameters:
      font - the new font of the text
    • setColor

      public void setColor​(Color color)
      set the color of the text to be displayed
      Parameters:
      color - the new color of the text
    • getNode

      public javafx.scene.Node getNode()
      Description copied from interface: Sprite
      The Sprite object
      Specified by:
      getNode in interface Sprite
      Returns:
      the Sprite object
    • resize

      public void resize​(double width, double height)
      Description copied from interface: Sprite
      resize the sprite to the following width and height
      Specified by:
      resize in interface Sprite