GAME
DESIGN IN LIBGDX
GUIDE – STILL IMAGES
DESCRIPTION CODE { private SpriteBatch batch; private Texture texture; private Sprite sprite; @Override public void create () { batch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("smiley256.png")); sprite = new Sprite(texture); } @Override public void dispose() { batch.dispose(); texture.dispose();
} @Override public void render() { //UPDATE - none //Clear screen Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); //Render batch.begin(); sprite.setPosition(200, 110); sprite.draw(batch); batch.end(); } } |