Class TextureBasedEntity<T extends BlendableEntity<?>>
- Type Parameters:
T
- a subclass inheriting Entity, used in order to return this as a T instead of aTextureBasedEntity
.
- Direct Known Subclasses:
SpriteAnimation
,SpriteBasedEntity
,TextBasedEntity
TextureBasedEntity
.-
Nested Class Summary
Nested classes/interfaces inherited from class com.codingame.gameengine.module.entities.BlendableEntity
BlendableEntity.BlendMode
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the X anchor of thisTextureBasedEntity
as a percentage of its width.double
Returns the Y anchor of thisTextureBasedEntity
as a percentage of its width.int
getTint()
Returns the tint of thisTextureBasedEntity
as an RGB integer.setAnchor
(double anchor) Sets both the X and Y anchors of thisTextureBasedEntity
as a percentage of its width and height.setAnchorX
(double anchorX) Sets the X anchor of thisTextureBasedEntity
as a percentage of its width.setAnchorX
(double anchorX, Curve curve) Sets the X anchor of thisTextureBasedEntity
as a percentage of its width.setAnchorY
(double anchorY) Sets the Y anchor of thisTextureBasedEntity
as a percentage of its width.setAnchorY
(double anchorY, Curve curve) Sets the Y anchor of thisTextureBasedEntity
as a percentage of its width.setTint
(int color) Sets the tint of thisTextureBasedEntity
as an RGB integer.Sets the tint of thisTextureBasedEntity
as an RGB integer.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
-
setAnchor
Sets both the X and Y anchors of thisTextureBasedEntity
as a percentage of its width and height.The point calculated by the anchors times the size of this
TextureBasedEntity
will be the origin for any rotation or scale.- Parameters:
anchor
- the percentage for both anchors of thisTextureBasedEntity
.- Returns:
- this
TextureBasedEntity
.
-
getAnchorX
public double getAnchorX()Returns the X anchor of thisTextureBasedEntity
as a percentage of its width.Default is 0.
- Returns:
- the X anchor of this
TextureBasedEntity
as a percentage of its width.
-
setAnchorX
Sets the X anchor of thisTextureBasedEntity
as a percentage of its width.The point calculated by the anchors times the size of this
TextureBasedEntity
will be the origin for any rotation or scale.Default is 0.
- Parameters:
anchorX
- the X anchor for thisTextureBasedEntity
.- Returns:
- this
TextureBasedEntity
.
-
setAnchorX
Sets the X anchor of thisTextureBasedEntity
as a percentage of its width.The point calculated by the anchors times the size of this
TextureBasedEntity
will be the origin for any rotation or scale.Default is 0.
- Parameters:
anchorX
- the X anchor for thisTextureBasedEntity
.curve
- the transition to animate between values of this property.- Returns:
- this
TextureBasedEntity
.
-
getAnchorY
public double getAnchorY()Returns the Y anchor of thisTextureBasedEntity
as a percentage of its width.Default is 0.
- Returns:
- the Y anchor of this
TextureBasedEntity
as a percentage of its width.
-
setAnchorY
Sets the Y anchor of thisTextureBasedEntity
as a percentage of its width.The point calculated by the anchors times the size of this
TextureBasedEntity
will be the origin for any rotation or scale.Default is 0.
- Parameters:
anchorY
- the Y anchor for thisTextureBasedEntity
.- Returns:
- this
TextureBasedEntity
.
-
setAnchorY
Sets the Y anchor of thisTextureBasedEntity
as a percentage of its width.The point calculated by the anchors times the size of this
TextureBasedEntity
will be the origin for any rotation or scale.Default is 0.
- Parameters:
anchorY
- the Y anchor for thisTextureBasedEntity
.curve
- the transition to animate between values of this property.- Returns:
- this
TextureBasedEntity
.
-
setTint
Sets the tint of thisTextureBasedEntity
as an RGB integer.Default is 0xFFFFFF (white)
- Parameters:
color
- the tint of thisTextureBasedEntity
.- Returns:
- this
TextureBasedEntity
. - Throws:
IllegalArgumentException
- if color is not a valid RGB integer.
-
setTint
Sets the tint of thisTextureBasedEntity
as an RGB integer.Default is 0xFFFFFF (white)
- Parameters:
color
- the tint of thisTextureBasedEntity
.curve
- the transition to animate between values of this property.- Returns:
- this
TextureBasedEntity
. - Throws:
IllegalArgumentException
- if color is not a valid RGB integer.
-
getTint
public int getTint()Returns the tint of thisTextureBasedEntity
as an RGB integer.Default is 0xFFFFFF (white)
- Returns:
- the tint of this
TextureBasedEntity
.
-