Back to project page killingspree.
The source code is released under:
MIT License
If you think the Android project killingspree listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sillygames.killingSpree.screens; /*www . j av a 2s .co m*/ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.utils.viewport.FitViewport; import com.sillygames.killingSpree.KillingSpree; public class SplashScreen extends AbstractScreen { private BitmapFont font; private SpriteBatch batch; private OrthographicCamera camera; private float totalTime = 0; private FitViewport viewport; public SplashScreen(KillingSpree game) { super(game); show(); } @Override public void render(float delta) { Gdx.gl.glClearColor(0, 0, 0, 0); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.setProjectionMatrix(camera.combined); batch.begin(); font.draw(batch, "Killing", viewport.getWorldWidth()/2 - 450, viewport.getWorldHeight() - 120); font.draw(batch, "Spree", viewport.getWorldWidth() / 2, viewport.getWorldHeight() - 380); batch.end(); if (totalTime < 2f){ totalTime += delta; } else { game.setScreen(new MainMenuScreen(game)); } } @Override public void resize(int width, int height) { viewport.update(width, height); camera.update(); } @Override public void show() { font = game.getFont(200); batch = new SpriteBatch(); camera = new OrthographicCamera(); viewport = new FitViewport(1280, 720, camera); camera.setToOrtho(false, 1280, 720); } @Override public void hide() { } @Override public void pause() { } @Override public void resume() { } @Override public void dispose() { font.dispose(); batch.dispose(); } }