Example usage for com.badlogic.gdx.graphics.g2d PolygonSpriteBatch PolygonSpriteBatch

List of usage examples for com.badlogic.gdx.graphics.g2d PolygonSpriteBatch PolygonSpriteBatch

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d PolygonSpriteBatch PolygonSpriteBatch.

Prototype

public PolygonSpriteBatch(int size) 

Source Link

Document

Constructs a PolygonSpriteBatch with the default shader and one buffer.

Usage

From source file:es.eucm.ead.editor.EditorApplicationListener.java

License:Open Source License

protected Stage createStage() {
    batch = new PolygonSpriteBatch(2500) {
        final int MAX = 2500 * 5;

        @Override//from  ww w  .j  a va  2  s.com
        public void draw(Texture texture, float[] spriteVertices, int offset, int count) {
            while (count > MAX) {
                super.draw(texture, spriteVertices, offset, MAX);
                offset += MAX;
                count -= MAX;
            }
            super.draw(texture, spriteVertices, offset, count);
        }
    };
    return new Stage(new ScreenViewport(), batch);
}