use of de.gg.camera.CameraWrapper in project ProjektGG by eskalon.
the class ProjektGG method create.
@Override
public final void create() {
if (debug)
Gdx.app.setLogLevel(Gdx.app.LOG_DEBUG);
else
Gdx.app.setLogLevel(Gdx.app.LOG_INFO);
// Initialize sprite batch
this.batch = new SpriteBatch();
// Initialize asset manager
FileHandleResolver resolver = new InternalFileHandleResolver();
this.assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
this.assetManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));
this.assetManager.setLoader(Text.class, new TextLoader(new InternalFileHandleResolver()));
this.viewportWidth = Gdx.graphics.getWidth();
this.viewportHeight = Gdx.graphics.getHeight();
// Initialize cameras
this.uiCamera = new OrthographicCamera(viewportWidth, viewportHeight);
this.uiCamera.translate(viewportWidth / 2, viewportHeight / 2, 0);
this.uiCamera.update();
this.gameCamera = new CameraWrapper(new PerspectiveCamera(67, viewportWidth, viewportHeight));
this.gameCamera.getCamera().translate(viewportWidth / 2, viewportHeight / 2, 0);
// this.camera.update();
this.batch.setProjectionMatrix(this.gameCamera.getCamera().combined);
// Load game settings
this.settings = new GameSettings("projekt-gg");
// Create the event bus
this.eventBus = new EventQueueBus();
// Create the network handler
this.networkHandler = new NetworkHandler(eventBus);
// Set input processor
Gdx.input.setInputProcessor(inputProcessor);
// Add screens
addScreen("splash", new SplashScreen());
addScreen("mainMenu", new MainMenuScreen());
addScreen("loading", new LoadingScreen());
addScreen("gameLoading", new GameLoadingScreen());
addScreen("serverBrowser", new ServerBrowserScreen());
addScreen("lobby", new LobbyScreen());
addScreen("lobbyCreation", new LobbyCreationScreen());
addScreen("map", new GameMapScreen());
addScreen("house", new GameInHouseScreen());
addScreen("roundEnd", new GameRoundendScreen());
// Push screen
if (showSplashscreen)
pushScreen("splash");
else
pushScreen("loading");
}
Aggregations