Class RepeatablePolygonSprite


  • public class RepeatablePolygonSprite
    extends java.lang.Object
    Renders polygon filled with a repeating TextureRegion with specified density Without causing an additional flush or render call
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float x  
      float y  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void draw​(PolygonSpriteBatch batch)  
      void setColor​(Color color)  
      void setPolygon​(TextureRegion region, float[] vertices)
      Sets polygon with repeating texture region, the size of repeating grid is equal to region size
      void setPolygon​(TextureRegion region, float[] vertices, float density)
      Sets polygon with repeating texture region, the size of repeating grid is equal to region size
      void setPosition​(float x, float y)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        public float x
      • y

        public float y
    • Constructor Detail

      • RepeatablePolygonSprite

        public RepeatablePolygonSprite()
    • Method Detail

      • setPolygon

        public void setPolygon​(TextureRegion region,
                               float[] vertices)
        Sets polygon with repeating texture region, the size of repeating grid is equal to region size
        Parameters:
        region - - region to repeat
        vertices - - cw vertices of polygon
      • setPolygon

        public void setPolygon​(TextureRegion region,
                               float[] vertices,
                               float density)
        Sets polygon with repeating texture region, the size of repeating grid is equal to region size
        Parameters:
        region - - region to repeat
        vertices - - cw vertices of polygon
        density - - number of regions per polygon width bound
      • setColor

        public void setColor​(Color color)
        Parameters:
        color - - Tint color to be applied to entire polygon
      • setPosition

        public void setPosition​(float x,
                                float y)