Search in sources :

Example 1 with CpuSpriteBatch

use of com.badlogic.gdx.graphics.g2d.CpuSpriteBatch in project libgdx by libgdx.

the class CpuSpriteBatchTest method create.

public void create() {
    Batch batch = new CpuSpriteBatch();
    // batch = new SpriteBatch();
    stage = new Stage(new ExtendViewport(500, 500), batch);
    Gdx.input.setInputProcessor(stage);
    texture = new Texture("data/bobargb8888-32x32.png");
    texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    TextureRegionDrawable drawable = new TextureRegionDrawable(new TextureRegion(texture));
    for (int i = 0; i < NUM_GROUPS; i++) {
        Group group = createActorGroup(drawable);
        stage.addActor(group);
    }
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) Group(com.badlogic.gdx.scenes.scene2d.Group) ExtendViewport(com.badlogic.gdx.utils.viewport.ExtendViewport) SpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch) Batch(com.badlogic.gdx.graphics.g2d.Batch) CpuSpriteBatch(com.badlogic.gdx.graphics.g2d.CpuSpriteBatch) Stage(com.badlogic.gdx.scenes.scene2d.Stage) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) CpuSpriteBatch(com.badlogic.gdx.graphics.g2d.CpuSpriteBatch) Texture(com.badlogic.gdx.graphics.Texture)

Aggregations

Texture (com.badlogic.gdx.graphics.Texture)1 Batch (com.badlogic.gdx.graphics.g2d.Batch)1 CpuSpriteBatch (com.badlogic.gdx.graphics.g2d.CpuSpriteBatch)1 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)1 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Group (com.badlogic.gdx.scenes.scene2d.Group)1 Stage (com.badlogic.gdx.scenes.scene2d.Stage)1 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)1 ExtendViewport (com.badlogic.gdx.utils.viewport.ExtendViewport)1