package com.mygdx.game; import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class FootBallsv0 extends ApplicationAdapter { OrthographicCamera camera; SpriteBatch batch; Texture textureBG; Sprite sprite; @Override public void create () { camera = new OrthographicCamera(); camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); batch = new SpriteBatch(); textureBG = new Texture("pitch_final.png"); textureBG.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); sprite = new Sprite(textureBG); } @Override public void render () { Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.setProjectionMatrix(camera.combined); batch.begin(); batch.draw(textureBG, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); batch.end(); } @Override public void resize(int width, int height) { camera.viewportWidth = width; camera.viewportHeight = height; camera.position.set(width/2f, height/2f, 0); } }