Class TextureAtlas.AtlasRegion

java.lang.Object
arc.graphics.g2d.TextureRegion
arc.graphics.g2d.TextureAtlas.AtlasRegion
Enclosing class:
TextureAtlas

public static class TextureAtlas.AtlasRegion extends TextureRegion
Describes the region of a packed image and provides information about the original image before it was packed.
  • Field Details

    • pixmapRegion

      public PixmapRegion pixmapRegion
    • name

      public String name
      The name of the original image file, up to the first underscore. Underscores denote special instructions to the texture packer.
    • offsetX

      public float offsetX
      The offset from the left of the original image to the left of the packed image, after whitespace was removed for packing.
    • offsetY

      public float offsetY
      The offset from the bottom of the original image to the bottom of the packed image, after whitespace was removed for packing.
    • packedWidth

      public int packedWidth
      The width of the image, after whitespace was removed for packing.
    • packedHeight

      public int packedHeight
      The height of the image, after whitespace was removed for packing.
    • originalWidth

      public int originalWidth
      The width of the image, before whitespace was removed and rotation was applied for packing.
    • originalHeight

      public int originalHeight
      The height of the image, before whitespace was removed for packing.
    • rotate

      public boolean rotate
      If true, the region has been rotated 90 degrees counter clockwise.
    • splits

      public int[] splits
      The ninepatch splits, or null if not a ninepatch. Has 4 elements: left, right, top, bottom.
    • pads

      public int[] pads
      The ninepatch pads, or null if not a ninepatch or the has no padding. Has 4 elements: left, right, top, bottom.
  • Constructor Details

    • AtlasRegion

      public AtlasRegion(Texture texture, int x, int y, int width, int height)
    • AtlasRegion

      public AtlasRegion()
    • AtlasRegion

      public AtlasRegion(TextureAtlas.AtlasRegion region)
    • AtlasRegion

      public AtlasRegion(TextureRegion region)
  • Method Details

    • flip

      public void flip(boolean x, boolean y)
      Flips the region, adjusting the offset so the image appears to be flip as if no whitespace has been removed for packing.
      Overrides:
      flip in class TextureRegion
    • getRotatedPackedWidth

      public float getRotatedPackedWidth()
      Returns the packed width considering the rotate value, if it is true then it returns the packedHeight, otherwise it returns the packedWidth.
    • getRotatedPackedHeight

      public float getRotatedPackedHeight()
      Returns the packed height considering the rotate value, if it is true then it returns the packedWidth, otherwise it returns the packedHeight.
    • toString

      public String toString()
      Overrides:
      toString in class TextureRegion