Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GameScreen implements Screen {
- SlingshotSteve game;
- public void Menu(SlingshotSteve game){
- this.game = game;
- }
- OrthographicCamera camera;
- SpriteBatch batch;
- TextureRegion backgroundTexture;
- Texture texture;
- GameScreen(final SlingshotSteve gam) {
- this.game = gam;
- camera = new OrthographicCamera(800, 480);
- batch = new SpriteBatch();
- Texture texture = new Texture(Gdx.files.internal("background.jpg"));
- backgroundTexture = new TextureRegion(texture, 0, 0, 500, 500);
- }
- public void render(float delta) {
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- camera.update();
- batch.setProjectionMatrix(camera.combined);
- batch.begin();
- batch.draw(backgroundTexture, 0, 0, SlingshotSteve.WIDTH, SlingshotSteve.HEIGHT);
- batch.end();
- }
- @Override
- public void dispose() {
- batch.dispose();
- texture.dispose();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement