List of usage examples for com.badlogic.gdx Application LOG_NONE
int LOG_NONE
To view the source code for com.badlogic.gdx Application LOG_NONE.
Click Source Link
From source file:com.gamejolt.mikykr5.ceidecpong.GameCore.java
License:Open Source License
@Override public void create() { AsyncAssetLoader loader = AsyncAssetLoader.getInstance(); // Set up rendering fields and settings. ShaderProgram.pedantic = false; // Not passing all variables to a shader will not close the game. batch = new SpriteBatch(); batch.enableBlending();//from w w w. j ava 2 s .co m batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); pixelPerfectCamera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); // Prepare the fading effect. Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Format.RGBA4444); pixmap.setColor(0, 0, 0, 1); pixmap.fill(); fadeTexture = new Texture(pixmap); pixmap.dispose(); // Create the initial interpolators and start with a fade in effect. alpha = new MutableFloat(1.0f); fadeOut = Tween.to(alpha, 0, 0.5f).target(1.0f).ease(TweenEquations.easeInQuint); fadeIn = Tween.to(alpha, 0, 2.5f).target(0.0f).ease(TweenEquations.easeInQuint); fadeIn.start(); fading = true; // Create application states. states = new BaseState[game_states_t.getNumStates()]; try { states[game_states_t.LOGO_SCREEN.getValue()] = new LogoScreenState(this); states[game_states_t.MAIN_MENU.getValue()] = new MainMenuState(this); states[game_states_t.IN_GAME.getValue()] = new InGameState(this); states[game_states_t.LOADING.getValue()] = new LoadingState(this); states[game_states_t.QUIT.getValue()] = null; } catch (IllegalArgumentException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Illegal argument caught creating states: ", e); System.exit(1); return; } // Register every state as an AssetsLoadedListener if the state implements the interface. for (BaseState state : states) { if (state != null && state instanceof AssetsLoadedListener) loader.addListener((AssetsLoadedListener) state); } AsyncAssetLoader.freeInstance(); loader = null; // Set the initial current and next states. currState = game_states_t.LOGO_SCREEN; nextState = null; this.setScreen(states[currState.getValue()]); // Set log level if (ProjectConstants.DEBUG) { Gdx.app.setLogLevel(Application.LOG_DEBUG); } else { Gdx.app.setLogLevel(Application.LOG_NONE); } }
From source file:io.piotrjastrzebski.sfg.SFGApp.java
License:Open Source License
public void init() { if (!DEBUG)/* ww w . j a va 2 s .c o m*/ Gdx.app.setLogLevel(Application.LOG_NONE); actionResolver.init(); Locator.provideActionResolver(actionResolver); playerStats = new PlayerStats(actionResolver); Locator.providePlayerStats(playerStats); settings = new Settings(); Locator.provideSettings(settings); config = new Config(); Locator.provideConfig(config); }
From source file:ve.ucv.ciens.ccg.nxtar.NxtARCore.java
License:Apache License
/** * <p>Initialize the member fields and launch the networking threads. Also creates and * sets the application states.</p> */// www . ja va2s . co m public void create() { try { ScenarioGlobals.init(this); } catch (IllegalArgumentException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Illegal argument initializing globals: ", e); System.exit(1); return; } catch (InstantiationException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Instantiation exception initializing globals: ", e); System.exit(1); return; } catch (IllegalAccessException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Illegal access exception initializing globals: ", e); System.exit(1); return; } // Set up rendering fields and settings. batch = new SpriteBatch(); batch.enableBlending(); batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); pixelPerfectCamera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); ShaderProgram.pedantic = false; // Create the state objects. states = new BaseState[game_states_t.getNumStates()]; try { if (Ouya.runningOnOuya) states[game_states_t.MAIN_MENU.getValue()] = new OuyaMainMenuState(this); else states[game_states_t.MAIN_MENU.getValue()] = new TabletMainMenuState(this); try { states[game_states_t.IN_GAME.getValue()] = new InGameState(this); } catch (IllegalStateException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Illegal state in IN_GAME_STATE: ", e); System.exit(1); return; } states[game_states_t.CALIBRATION.getValue()] = new CameraCalibrationState(this); try { states[game_states_t.AUTOMATIC_ACTION.getValue()] = new AutomaticActionState(this); } catch (IllegalStateException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Illegal state in AUTOMATIC_ACTION_STATE: ", e); System.exit(1); return; } states[game_states_t.AUTOMATIC_ACTION_SUMMARY.getValue()] = new AutomaticActionSummaryState(this); states[game_states_t.SCENARIO_END_SUMMARY.getValue()] = new ScenarioEndSummaryState(this); states[game_states_t.HINTS.getValue()] = new InstructionsState(this); } catch (IllegalArgumentException e) { Gdx.app.error(TAG, CLASS_NAME + ".create(): Illegal argument caught creating states: ", e); System.exit(1); return; } // Register controller listeners. for (BaseState state : states) { Controllers.addListener(state); } // Set up the overlay font. overlayX = -(Utils.getScreenWidthWithOverscan() / 2) + 10; overlayY = (Utils.getScreenHeightWithOverscan() / 2) - 10; font = new BitmapFont(); font.setColor(1.0f, 1.0f, 0.0f, 1.0f); if (!Ouya.runningOnOuya) { font.setScale(1.0f); } else { font.setScale(2.5f); } // Start networking. actionResolver.enableMulticast(); Gdx.app.debug(TAG, CLASS_NAME + ".create() :: Creating network threads"); serviceDiscoveryThread = ServiceDiscoveryThread.getInstance(); videoThread = VideoStreamingThread.getInstance(); robotThread = RobotControlThread.getInstance(); sensorThread = SensorReportThread.getInstance(); // Launch networking threads. serviceDiscoveryThread.start(); videoThread.start(); videoThread.startStreaming(); videoThread.addNetworkConnectionListener(this); robotThread.addNetworkConnectionListener(this); robotThread.start(); sensorThread.addNetworkConnectionListener(this); sensorThread.start(); // Set the current and next states. currState = game_states_t.MAIN_MENU; nextState = null; this.setScreen(states[currState.getValue()]); states[currState.getValue()].onStateSet(); // Prepare the fading effect. Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Format.RGBA4444); pixmap.setColor(0, 0, 0, 1); pixmap.fill(); fadeTexture = new Texture(pixmap); pixmap.dispose(); alpha = new MutableFloat(0.0f); fadeOut = Tween.to(alpha, 0, 0.5f).target(1.0f).ease(TweenEquations.easeInQuint); fadeIn = Tween.to(alpha, 0, 0.5f).target(0.0f).ease(TweenEquations.easeInQuint); fading = false; // Set initial input handlers. Gdx.input.setInputProcessor(states[currState.getValue()]); Controllers.addListener(states[currState.getValue()]); // Set log level if (ProjectConstants.DEBUG) { Gdx.app.setLogLevel(Application.LOG_DEBUG); } else { Gdx.app.setLogLevel(Application.LOG_NONE); } }