Class TextureBasedEntity<T extends BlendableEntity<?>>

Type Parameters:
T - a subclass inheriting Entity, used in order to return this as a T instead of a TextureBasedEntity.
Direct Known Subclasses:
SpriteAnimation, SpriteBasedEntity, TextBasedEntity

public abstract class TextureBasedEntity<T extends BlendableEntity<?>> extends BlendableEntity<T>
Any PIXI Entity based on a texture shares the properties found in this TextureBasedEntity.
  • Method Details

    • setAnchor

      public T setAnchor(double anchor)
      Sets both the X and Y anchors of this 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.

      Parameters:
      anchor - the percentage for both anchors of this TextureBasedEntity.
      Returns:
      this TextureBasedEntity.
    • getAnchorX

      public double getAnchorX()
      Returns the X anchor of this TextureBasedEntity as a percentage of its width.

      Default is 0.

      Returns:
      the X anchor of this TextureBasedEntity as a percentage of its width.
    • setAnchorX

      public T setAnchorX(double anchorX)
      Sets the X anchor of this 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.

      Default is 0.

      Parameters:
      anchorX - the X anchor for this TextureBasedEntity.
      Returns:
      this TextureBasedEntity.
    • setAnchorX

      public T setAnchorX(double anchorX, Curve curve)
      Sets the X anchor of this 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.

      Default is 0.

      Parameters:
      anchorX - the X anchor for this TextureBasedEntity.
      curve - the transition to animate between values of this property.
      Returns:
      this TextureBasedEntity.
    • getAnchorY

      public double getAnchorY()
      Returns the Y anchor of this TextureBasedEntity as a percentage of its width.

      Default is 0.

      Returns:
      the Y anchor of this TextureBasedEntity as a percentage of its width.
    • setAnchorY

      public T setAnchorY(double anchorY)
      Sets the Y anchor of this 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.

      Default is 0.

      Parameters:
      anchorY - the Y anchor for this TextureBasedEntity.
      Returns:
      this TextureBasedEntity.
    • setAnchorY

      public T setAnchorY(double anchorY, Curve curve)
      Sets the Y anchor of this 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.

      Default is 0.

      Parameters:
      anchorY - the Y anchor for this TextureBasedEntity.
      curve - the transition to animate between values of this property.
      Returns:
      this TextureBasedEntity.
    • setTint

      public T setTint(int color)
      Sets the tint of this TextureBasedEntity as an RGB integer.

      Default is 0xFFFFFF (white)

      Parameters:
      color - the tint of this TextureBasedEntity.
      Returns:
      this TextureBasedEntity.
      Throws:
      IllegalArgumentException - if color is not a valid RGB integer.
    • setTint

      public T setTint(int color, Curve curve)
      Sets the tint of this TextureBasedEntity as an RGB integer.

      Default is 0xFFFFFF (white)

      Parameters:
      color - the tint of this TextureBasedEntity.
      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 this TextureBasedEntity as an RGB integer.

      Default is 0xFFFFFF (white)

      Returns:
      the tint of this TextureBasedEntity.