TEST SCREEN
Everything is same with previous test screens. I added a loading animation which will fade in 6 seconds and auto go back to all tests screen.
-
SPLASH / LOADING
If you work with lightweight assets/resorces and making not a very large game you can fake splash and loading screen easily, but if your have large amount of assets and need a real loading performer with percentage you will need AssetManager, pretty cool thing, but I wont be talking about that.
I created a "Loading" object which only extends "AbstractActor", nothing else, I added my loading animation
Then in my render method I get the seconds from "AbstractScreen" and 6 seconds later, I make my loading animation fade out, and then auto go to back all tests screen.
DONE IN A FLASH
Everything is same with previous test screens. I added a loading animation which will fade in 6 seconds and auto go back to all tests screen.
-
SPLASH / LOADING
If you work with lightweight assets/resorces and making not a very large game you can fake splash and loading screen easily, but if your have large amount of assets and need a real loading performer with percentage you will need AssetManager, pretty cool thing, but I wont be talking about that.
I created a "Loading" object which only extends "AbstractActor", nothing else, I added my loading animation
private void setUpSplash() {
// #5.1 Test
// Create a loading anim (NOT REAL), center it
// "Loading" is a model, it just extends abstractactor
// #########################################################
loading = new Loading(getStage().getWidth() / 2 - 50, getStage().getHeight() / 2 - 50, 100, 100);
loading.setAnimation(Assets.animLoadingSkull, true, true);
getStage().addActor(loading);
}
Then in my render method I get the seconds from "AbstractScreen" and 6 seconds later, I make my loading animation fade out, and then auto go to back all tests screen.
@Override
public void render(float delta) {
super.render(delta);
lblScreenTime.setText(getScreenTime());
lblFps.setText("Fps: " + Gdx.graphics.getFramesPerSecond());
//
if(getSecondsTime() > 6){
loading.addAction(Actions.sequence(
Actions.fadeOut(0.8f),
new Action() {
@Override
public boolean act(float delta) {
getGame().setScreen(new Test0_AllTestsScreen(getGame(), "All tests"));
return false;
}
}
));
}
}
DONE IN A FLASH
- Super fast implementation
- far less code writing
- Effective and cool looking
- Plenty of action types you can use, plus you can create cool animations or particles
0 yorum:
Yorum Gönder