/** Creates a stage with the specified viewport. The stage will use its own {@link Batch} which will be disposed when the stage * is disposed. */ public Stage (Viewport viewport) { this(viewport, new SpriteBatch()); ownsBatch = true; }
public BatchTiledMapRenderer (TiledMap map, float unitScale) { this.map = map; this.unitScale = unitScale; this.viewBounds = new Rectangle(); this.batch = new SpriteBatch(); this.ownsBatch = true; }
@Override public void create () { batch = new SpriteBatch(); font = new BitmapFont(); }
@Override public void create () { camera = new OrthographicCamera(); batch = new SpriteBatch(); long start = System.currentTimeMillis(); int glyphCount = createFonts(); long time = System.currentTimeMillis() - start; text = glyphCount + " glyphs packed in " + regions.size + " page(s) in " + time + " ms"; }
@Override public void create () { spriteBatch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/test.png")); } }
@Override public void create () { batch = new SpriteBatch(); img = new Texture("data/issue/bark.png"); img2 = new Texture("data/issue/leaf.png"); }
@Override public void create () { batch = new SpriteBatch(); font = new BitmapFont(Gdx.files.internal("data/utf-font.fnt")); }
public void create () { batch = new SpriteBatch(); font = new BitmapFont(); text = ""; Gdx.input.setInputProcessor(this); // Gdx.input.setOnscreenKeyboardVisible(true); }
@Override public void create() { camera = new OrthographicCamera(); batch = new SpriteBatch(); long start = System.currentTimeMillis(); int glyphCount = createFonts(); long time = System.currentTimeMillis() - start; text = glyphCount + " glyphs packed in " + packer.getPages().size + " page(s) in " + time + " ms"; }
@Override public void create () { font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false); batch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg")); }
public void create () { rgb888 = new Texture("data/bobrgb888-32x32.png"); rgba8888 = new Texture("data/bobargb8888-32x32.png"); psRgb888 = new Texture("data/alpha.png"); psRgba8888 = new Texture("data/rgb.png"); batch = new SpriteBatch(); }
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)); }
@Override public void create () { batch = new SpriteBatch(); font = new BitmapFont(); tex = new Texture(Gdx.files.internal("data/badlogic.jpg")); DisplayMode[] modes = Gdx.graphics.getDisplayModes(); for (DisplayMode mode : modes) { System.out.println(mode); } Gdx.app.log("FullscreenTest", Gdx.graphics.getBufferFormat().toString()); }
/** Creates a stage with a {@link ScalingViewport} set to {@link Scaling#stretch}. The stage will use its own {@link Batch} * which will be disposed when the stage is disposed. */ public Stage () { this(new ScalingViewport(Scaling.stretch, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), new OrthographicCamera()), new SpriteBatch()); ownsBatch = true; }
@Override public void create () { batch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/g2d/progressive-libgdx.jpg")); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); drawable = new TextureRegionDrawable(new TextureRegion(texture)); }
@Override public void create () { region = new TextureRegion(new Texture("data/badlogicsmall.jpg")); batch = new SpriteBatch(); renderer = new ShapeRenderer(); renderer.setProjectionMatrix(batch.getProjectionMatrix()); }
@Override public void create () { Pixmap pixmap = new Pixmap(256, 256, Format.RGBA8888); pixmap.setColor(1, 0, 0, 1); pixmap.fill(); texture = new Texture(pixmap, false); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); batch = new SpriteBatch(); pixmap.dispose(); }
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); }
@Override public void create () { world = new World(new Vector2(0, -40), true); renderer = new Box2DDebugRenderer(); cam = new OrthographicCamera(28, 20); createWorld(); Gdx.input.setInputProcessor(this); batch = new SpriteBatch(); font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false); }
public void create () { renderer = new ShapeRenderer(); cam = new PerspectiveCamera(47, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(0, 0, 2); cam.near = 0.1f; controller = new PerspectiveCamController(cam); Gdx.input.setInputProcessor(controller); batch = new SpriteBatch(); font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false); }