\r
@Override\r
public void setContinuousRendering (boolean isContinuous) {\r
- throw new GdxRuntimeException("No supported");\r
}\r
\r
@Override\r
public boolean isContinuousRendering () {\r
- throw new GdxRuntimeException("No supported");\r
+ return false;\r
}\r
\r
@Override\r
public void requestRendering () {\r
- throw new GdxRuntimeException("No supported");\r
}\r
\r
@Override\r
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Pixmap.Format;
+import com.badlogic.gdx.graphics.PixmapIO;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.PixmapPacker;
+import com.badlogic.gdx.graphics.g2d.PixmapPacker.Page;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.tests.utils.GdxTest;
Pixmap pixmap2 = new Pixmap(Gdx.files.internal("data/wheel.png"));
Pixmap pixmap3 = new Pixmap(Gdx.files.internal("data/egg.png"));
- PixmapPacker packer = new PixmapPacker(256, 256, Format.RGBA8888, 2, true);
+ PixmapPacker packer = new PixmapPacker(1024, 1024, Format.RGBA8888, 2, true);
packer.pack("badlogic", pixmap1);
packer.pack("wheel", pixmap1);
- packer.pack("egg", pixmap1);
+ packer.pack("egg", pixmap1);
+
+ for(Page page: packer.getPages()) {
+ PixmapIO.writePNG(Gdx.files.absolute("out.png"), page.getPixmap());
+ }
atlas = packer.generateTextureAtlas(TextureFilter.Nearest, TextureFilter.Nearest, false);
Gdx.app.log("PixmaPackerTest", "Number of textures: " + atlas.getTextures().size());