SHARE
TWEET
Untitled
a guest
Sep 17th, 2014
180
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- public class SplashScreen implements Screen {
- private float time=0;
- private BitmapFont font;
- private SpriteBatch batch;
- private GOW game;
- private boolean test;
- public SplashScreen(GOW game){
- this.game=game;
- }
- @Override
- public void show() {
- font=Asset.font;
- batch = new SpriteBatch();
- new Thread(new Runnable() {
- @Override
- public void run() {
- Asset.initDict(); // long operation
- test=true;
- }
- }).start();
- Asset.initGraphs(); // fast operation
- }
- @Override
- public void render(float delta) {
- boolean end= gradient(delta);
- Gdx.gl.glClearColor(time*1f, 0.0f, 0, 1);
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- batch.begin();
- if(end&test){
- game.setScreen(new TrainScreen());
- }
- batch.end();
- }
- private boolean gradient(float delta){
- if(time<4f) {
- time += delta;
- if(time>4f) {
- time = 4f;
- }
- return false;
- }
- return true;
- }
- @Override
- public void resize(int width, int height) {
- }
- @Override
- public void hide() {
- }
- @Override
- public void pause() {
- }
- @Override
- public void resume() {
- }
- @Override
- public void dispose() {
- }
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
