Created
October 16, 2017 09:41
-
-
Save sparkica/3ee45a49b7f73f27083c335c60bd94ab to your computer and use it in GitHub Desktop.
Beginning game development with LibGDX - creating SpriteBatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GameDemo extends ApplicationAdapter { | |
SpriteBatch batch; | |
Texture img; | |
@Override | |
public void create() { | |
batch = new SpriteBatch(); | |
img = new Texture("badlogic.jpg"); | |
} | |
@Override | |
public void render() { | |
Gdx.gl.glClearColor(1, 0, 0, 1); | |
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); | |
batch.begin(); | |
batch.draw(img, 0, 0); | |
batch.end(); | |
} | |
@Override | |
public void dispose() { | |
batch.dispose(); | |
img.dispose(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment