Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main extends Game {
- public static final int V_WIDTH = 1920;
- public static final int V_HEIGHT = 1080;
- OrthographicCamera cam;
- Stage stage;
- TextureAtlas atlas;
- Image Logo;
- @Override
- public void create () {
- cam = new OrthographicCamera();
- cam.setToOrtho(false, 800, 600);
- stage = new Stage(new FitViewport(V_WIDTH, V_HEIGHT, cam));
- atlas = new TextureAtlas("LoadingScreen.pack");
- Logo = new Image(atlas.findRegion("VeslaLogo"));
- Logo.setX(stage.getWidth() / 2 - Logo.getWidth() / 2);
- Logo.setY(stage.getHeight() / 2 - Logo.getHeight() / 2);
- stage.addActor(Logo);
- }
- @Override
- public void resize(int width, int height) {
- stage.getViewport().update(width, height, false);
- }
- @Override
- public void render () {
- Gdx.gl.glClearColor(1, 0, 0, 1);
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- stage.act();
- stage.draw();
- }
- @Override
- public void dispose() {
- atlas.dispose();
- stage.dispose();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement