Class Text
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
-
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 objectvoid
resize(double width, double height)
resize the sprite to the following width and heightvoid
setColor(Color color)
set the color of the text to be displayedvoid
setFont(java.lang.String font)
set the font of the text to be displayedvoid
setSize(int size)
set the size of the text to be displayedvoid
setText(java.lang.String text)
set the text to be displayedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
size
private int size -
font
private java.lang.String font -
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
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 -
resize
public void resize(double width, double height)Description copied from interface:Sprite
resize the sprite to the following width and height
-