use of com.badlogic.gdx.graphics.glutils.FileTextureData in project libgdx by libgdx.
the class TextureAtlasPanel method setAtlas.
public void setAtlas(TextureAtlas atlas) {
if (atlas == this.atlas)
return;
regionsPanel.removeAll();
Array<AtlasRegion> atlasRegions = atlas.getRegions();
CustomCardLayout layout = (CustomCardLayout) regionsPanel.getLayout();
Array<TextureRegion> regions = new Array<TextureRegion>();
for (Texture texture : atlas.getTextures()) {
FileTextureData file = (FileTextureData) texture.getTextureData();
regionsPanel.add(new TexturePanel(texture, getRegions(texture, atlasRegions, regions)));
}
layout.first(regionsPanel);
this.atlas = atlas;
}
use of com.badlogic.gdx.graphics.glutils.FileTextureData in project libgdx by libgdx.
the class TexturePanel method setTexture.
public void setTexture(Texture texture) {
if (this.texture == texture)
return;
this.texture = texture;
FileTextureData data = (FileTextureData) texture.getTextureData();
setImage(data.getFileHandle().file().getAbsolutePath());
}
use of com.badlogic.gdx.graphics.glutils.FileTextureData in project libgdx by libgdx.
the class TextureDataTest method create.
public void create() {
spriteBatch = new SpriteBatch();
// texture = new Texture(new PixmapTextureData(new Pixmap(Gdx.files.internal("data/t8890.png")), null, false, true));
texture = new Texture(new FileTextureData(Gdx.files.internal("data/t8890.png"), null, null, false));
}
use of com.badlogic.gdx.graphics.glutils.FileTextureData in project commons-gdx by gemserk.
the class GpuMemUtils method getFilePath.
private static String getFilePath(Texture texture) {
String path = null;
TextureData textureData = texture.getTextureData();
if (textureData instanceof FileTextureData) {
FileTextureData fileTextureData = (FileTextureData) textureData;
path = fileTextureData.getFileHandle().path();
}
return path;
}
use of com.badlogic.gdx.graphics.glutils.FileTextureData in project libgdx by libgdx.
the class GWTLossyPremultipliedAlphaTest method create.
public void create() {
batch = new SpriteBatch();
// Load a texture with premultiplied alpha
FileTextureData data = new FileTextureData(Gdx.files.internal("data/premultiplied_alpha_test.png"), null, null, false);
goodTexture = new Texture(data);
// Load the texture again. But this time, force the GWT implementation of Pixmap to move to a Canvas representation of the image
Pixmap pixmap = new Pixmap(Gdx.files.internal("data/premultiplied_alpha_test.png"));
pixmap.getPixel(0, 0);
FileTextureData data1 = new FileTextureData(null, pixmap, null, false);
badTexture = new Texture(data1);
}
Aggregations