Texture texture = textureRegion.getTexture(); if (!texture.getTextureData().isPrepared()) { texture.getTextureData().prepare(); } Pixmap pixmap = texture.getTextureData().consumePixmap();
If you need only part of this texture (region), you will have to do some manual processing:
for (int x = 0; x < textureRegion.getRegionWidth(); x++) { for (int y = 0; y < textureRegion.getRegionHeight(); y++) { int colorInt = pixmap.getPixel(textureRegion.getRegionX() + x, textureRegion.getRegionY() + y);
source share