Class Text
java.lang.Object
com.codingame.gameengine.module.entities.Entity<T>
com.codingame.gameengine.module.entities.BlendableEntity<T>
com.codingame.gameengine.module.entities.TextureBasedEntity<T>
com.codingame.gameengine.module.entities.TextBasedEntity<Text>
com.codingame.gameengine.module.entities.Text
Represents a label on screen.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.codingame.gameengine.module.entities.TextBasedEntity
TextBasedEntity.TextAlignNested classes/interfaces inherited from class com.codingame.gameengine.module.entities.BlendableEntity
BlendableEntity.BlendMode -
Field Summary
Fields inherited from class com.codingame.gameengine.module.entities.TextBasedEntity
fontSize, maxWidth, text, textAlign -
Method Summary
Modifier and TypeMethodDescriptionintReturns the color of the fill of thisTextas an RGB integer.Returns the name of the font of thisTextin px.Returns the weight of the font of thisText.intReturns the color of the stroke of thisTextas an RGB integer.doubleReturns the thickness of the stroke of thisTextin pixels.setFillColor(int fillColor) Sets the color of the fill of thisTextas an RGB integer.setFillColor(int fillColor, Curve curve) Sets the color of the fill of thisTextas an RGB integer.setFontFamily(String fontFamily) Sets the name of the font of thisText.setFontWeight(Text.FontWeight weight) Sets the weight of the font of thisText.setStrokeColor(int strokeColor) Sets the color of the stroke of thisTextas an RGB integer.setStrokeColor(int strokeColor, Curve curve) Sets the color of the stroke of thisTextas an RGB integer.setStrokeThickness(double strokeThickness) Returns the thickness of the stroke of thisTextin pixels.setStrokeThickness(double strokeThickness, Curve curve) Returns the thickness of the stroke of thisTextin pixels.Methods inherited from class com.codingame.gameengine.module.entities.TextBasedEntity
getFontSize, getMaxWidth, getText, getTextAlign, setFontSize, setFontSize, setMaxWidth, setText, setTextAlignMethods inherited from class com.codingame.gameengine.module.entities.TextureBasedEntity
getAnchorX, getAnchorY, getTint, setAnchor, setAnchorX, setAnchorX, setAnchorY, setAnchorY, setTint, setTintMethods inherited from class com.codingame.gameengine.module.entities.BlendableEntity
getBlendMode, setBlendModeMethods inherited from class com.codingame.gameengine.module.entities.Entity
getAlpha, getId, getMask, getParent, getRotation, getScaleX, getScaleY, getSkewX, getSkewY, getX, getY, getZIndex, isVisible, requireValidAlpha, requireValidColor, self, set, set, setAlpha, setAlpha, setMask, setMask, setRotation, setRotation, setScale, setScale, setScaleX, setScaleX, setScaleY, setScaleY, setSkewX, setSkewX, setSkewY, setSkewY, setVisible, setX, setX, setY, setY, setZIndex
-
Method Details
-
getStrokeColor
public int getStrokeColor()Returns the color of the stroke of thisTextas an RGB integer.Default is 0 (black).
- Returns:
- the string of this
Text.
-
setStrokeColor
Sets the color of the stroke of thisTextas an RGB integer.Default is 0 (black).
- Parameters:
strokeColor- the color for the stroke of thisText.- Returns:
- this
Text. - Throws:
IllegalArgumentException- if strokeColor is not a valid RGB integer.
-
setStrokeColor
Sets the color of the stroke of thisTextas an RGB integer.Default is 0 (black).
- Parameters:
strokeColor- the color for the stroke of thisText.curve- the transition to animate between values of this property.- Returns:
- this
Text. - Throws:
IllegalArgumentException- if strokeColor is not a valid RGB integer.
-
getFontFamily
Returns the name of the font of thisTextin px.Default is "Lato".
- Returns:
- the size of the font of this
Text.
-
setFontFamily
Sets the name of the font of thisText.Only fonts available to the browser can be displayed.
Default is "Lato".
- Parameters:
fontFamily- the size for the font of thisText.- Returns:
- this
Text.
-
getStrokeThickness
public double getStrokeThickness()Returns the thickness of the stroke of thisTextin pixels.Default is 0 (no stroke).
- Returns:
- the thickness of the stroke of this
Text
-
setStrokeThickness
Returns the thickness of the stroke of thisTextin pixels.Default is 0 (no stroke).
- Parameters:
strokeThickness- the thickness for the stroke of thisText.- Returns:
- this
Text
-
setStrokeThickness
Returns the thickness of the stroke of thisTextin pixels.Default is 0 (no stroke).
- Parameters:
strokeThickness- the thickness for the stroke of thisText.curve- the transition to animate between values of this property.- Returns:
- this
Text
-
setFontWeight
Sets the weight of the font of thisText.Default is NORMAL.
- Parameters:
weight- the FontWeight of theText.- Returns:
- this
Text.
-
getFontWeight
Returns the weight of the font of thisText.Default is NORMAL.
- Returns:
- the weight of the font of this
Text.
-
getFillColor
public int getFillColor()Returns the color of the fill of thisTextas an RGB integer.Default is 0 (black).
- Returns:
- the color of the fill of this
Text
-
setFillColor
Sets the color of the fill of thisTextas an RGB integer.Default is 0 (black).
- Parameters:
fillColor- the color for the fill of thisText.- Returns:
- this
Text. - Throws:
IllegalArgumentException- if fillColor is not a valid RGB integer.
-
setFillColor
Sets the color of the fill of thisTextas an RGB integer.Default is 0 (black).
- Parameters:
fillColor- the color for the fill of thisText.curve- the transition to animate between values of this property.- Returns:
- this
Text. - Throws:
IllegalArgumentException- if fillColor is not a valid RGB integer.
-