public class Sprite extends Entity<T>
assets folder of your game's project.| Modifier and Type | Class and Description |
|---|---|
static class |
TextureBasedEntity.BlendMode
The list of supported PIXI blend modes and their associated constant.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getAnchorX()
Returns the X anchor of this
TextureBasedEntity as a percentage of its width. |
double |
getAnchorY()
Returns the Y anchor of this
TextureBasedEntity as a percentage of its width. |
TextureBasedEntity.BlendMode |
getBlendMode()
Returns the
BlendMode this TextureBasedEntity is to be drawn with. |
java.lang.String |
getImage()
Returns the name of the image used for this
Sprite. |
int |
getTint()
Returns the tint of this
TextureBasedEntity as an RGB integer. |
T |
setAnchor(double anchor)
Sets both the X and Y anchors of this
TextureBasedEntity as a percentage of its width and height. |
T |
setAnchorX(double anchorX)
Sets the X anchor of this
TextureBasedEntity as a percentage of its width. |
T |
setAnchorX(double anchorX,
Curve curve)
Sets the X anchor of this
TextureBasedEntity as a percentage of its width. |
T |
setAnchorY(double anchorY)
Sets the Y anchor of this
TextureBasedEntity as a percentage of its width. |
T |
setAnchorY(double anchorY,
Curve curve)
Sets the Y anchor of this
TextureBasedEntity as a percentage of its width. |
T |
setBlendMode(TextureBasedEntity.BlendMode blendMode)
Sets the blend mode for this
TextureBasedEntity. |
Sprite |
setImage(java.lang.String image)
Sets the image for this
Sprite. |
Sprite |
setImage(java.lang.String image,
Curve curve)
Sets the image for this
Sprite. |
T |
setTint(int color)
Sets the tint of this
TextureBasedEntity as an RGB integer. |
T |
setTint(int color,
Curve curve)
Sets the tint of this
TextureBasedEntity as an RGB integer. |
getAlpha, getId, getRotation, getScaleX, getScaleY, getX, getY, getZIndex, isVisible, setAlpha, setAlpha, setRotation, setRotation, setScale, setScale, setScaleX, setScaleX, setScaleY, setScaleY, setVisible, setX, setX, setY, setY, setZIndexpublic Sprite setImage(java.lang.String image)
Sprite.
You must either:
image - the name of the image to use for this Sprite.Sprite.public Sprite setImage(java.lang.String image, Curve curve)
Sprite.
You must either:
image - the name of the image to use for this Sprite.curve - the transition to animate between values of this property.Sprite.public java.lang.String getImage()
Sprite.
Can be a player's nickname token.
Spritepublic TextureBasedEntity.BlendMode getBlendMode()
BlendMode this TextureBasedEntity is to be drawn with.BlendMode this TextureBasedEntity is to be drawn with.public T setBlendMode(TextureBasedEntity.BlendMode blendMode)
TextureBasedEntity.
The possible values are found in BlendMode.
blendMode - TextureBasedEntity.public T setAnchor(double anchor)
TextureBasedEntity 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.
anchor - the percentage for both anchors of this TextureBasedEntity.TextureBasedEntity.public double getAnchorX()
TextureBasedEntity as a percentage of its width.
Default is 0.
TextureBasedEntity as a percentage of its width.public T setAnchorX(double anchorX)
TextureBasedEntity 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.
anchorX - the X anchor for this TextureBasedEntity.TextureBasedEntity.public T setAnchorX(double anchorX,
Curve curve)
TextureBasedEntity 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.
anchorX - the X anchor for this TextureBasedEntity.curve - the transition to animate between values of this property.TextureBasedEntity.public double getAnchorY()
TextureBasedEntity as a percentage of its width.
Default is 0.
TextureBasedEntity as a percentage of its width.public T setAnchorY(double anchorY)
TextureBasedEntity 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.
anchorY - the Y anchor for this TextureBasedEntity.TextureBasedEntity.public T setAnchorY(double anchorY,
Curve curve)
TextureBasedEntity 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.
anchorY - the Y anchor for this TextureBasedEntity.curve - the transition to animate between values of this property.TextureBasedEntity.public T setTint(int color)
TextureBasedEntity as an RGB integer.color - the tint of this TextureBasedEntity.TextureBasedEntity.java.lang.IllegalArgumentException - if color is not a valid RGB integer.public T setTint(int color,
Curve curve)
TextureBasedEntity as an RGB integer.color - the tint of this TextureBasedEntity.curve - the transition to animate between values of this property.TextureBasedEntity.java.lang.IllegalArgumentException - if color is not a valid RGB integer.public int getTint()
TextureBasedEntity as an RGB integer.
Default is 0xFFFFFF (white)
TextureBasedEntity.