Class GDXTexture

  • All Implemented Interfaces:
    Image

    public class GDXTexture
    extends java.lang.Object
    implements Image
    Refers to a texture that is managed by libGDX. Each texture also keeps track of all regions that have been defined within it.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GDXTexture​(com.badlogic.gdx.graphics.Texture texture)  
      protected GDXTexture​(com.badlogic.gdx.graphics.Texture texture, Rect bounds)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()  
      int getAlpha​(int x, int y)
      Returns the alpha of a pixel within the image.
      ColorRGB getColor​(int x, int y)  
      int getHeight()  
      Image getRegion​(Rect region)
      Returns an Image instance that only contains the specified region from within this image.
      com.badlogic.gdx.graphics.Texture getTexture()  
      com.badlogic.gdx.graphics.g2d.TextureRegion getTextureRegion()  
      int getWidth()  
      • Methods inherited from class java.lang.Object

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

      • GDXTexture

        protected GDXTexture​(com.badlogic.gdx.graphics.Texture texture,
                             Rect bounds)
      • GDXTexture

        protected GDXTexture​(com.badlogic.gdx.graphics.Texture texture)
    • Method Detail

      • getTexture

        public com.badlogic.gdx.graphics.Texture getTexture()
      • getTextureRegion

        public com.badlogic.gdx.graphics.g2d.TextureRegion getTextureRegion()
      • getWidth

        public int getWidth()
        Specified by:
        getWidth in interface Image
      • getHeight

        public int getHeight()
        Specified by:
        getHeight in interface Image
      • getRegion

        public Image getRegion​(Rect region)
        Description copied from interface: Image
        Returns an Image instance that only contains the specified region from within this image.
        Specified by:
        getRegion in interface Image
      • getAlpha

        public int getAlpha​(int x,
                            int y)
        Description copied from interface: Image
        Returns the alpha of a pixel within the image. The returned value is between 0 (fully transparent) and 100 (fully opaque).
        Specified by:
        getAlpha in interface Image
      • dispose

        public void dispose()