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 classes/interfaces inherited from class com.codingame.gameengine.module.entities.TextBasedEntity
TextBasedEntity.TextAlign
Nested 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 TypeMethodDescriptionint
Returns the color of the fill of thisText
as an RGB integer.Returns the name of the font of thisText
in px.Returns the weight of the font of thisText
.int
Returns the color of the stroke of thisText
as an RGB integer.double
Returns the thickness of the stroke of thisText
in pixels.setFillColor
(int fillColor) Sets the color of the fill of thisText
as an RGB integer.setFillColor
(int fillColor, Curve curve) Sets the color of the fill of thisText
as 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 thisText
as an RGB integer.setStrokeColor
(int strokeColor, Curve curve) Sets the color of the stroke of thisText
as an RGB integer.setStrokeThickness
(double strokeThickness) Returns the thickness of the stroke of thisText
in pixels.setStrokeThickness
(double strokeThickness, Curve curve) Returns the thickness of the stroke of thisText
in pixels.Methods inherited from class com.codingame.gameengine.module.entities.TextBasedEntity
getFontSize, getMaxWidth, getText, getTextAlign, setFontSize, setFontSize, setMaxWidth, setText, setTextAlign
Methods inherited from class com.codingame.gameengine.module.entities.TextureBasedEntity
getAnchorX, getAnchorY, getTint, setAnchor, setAnchorX, setAnchorX, setAnchorY, setAnchorY, setTint, setTint
Methods inherited from class com.codingame.gameengine.module.entities.BlendableEntity
getBlendMode, setBlendMode
Methods 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 thisText
as an RGB integer.Default is 0 (black).
- Returns:
- the string of this
Text
.
-
setStrokeColor
Sets the color of the stroke of thisText
as 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 thisText
as 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 thisText
in 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 thisText
in pixels.Default is 0 (no stroke).
- Returns:
- the thickness of the stroke of this
Text
-
setStrokeThickness
Returns the thickness of the stroke of thisText
in 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 thisText
in 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 thisText
as an RGB integer.Default is 0 (black).
- Returns:
- the color of the fill of this
Text
-
setFillColor
Sets the color of the fill of thisText
as 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 thisText
as 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.
-