Example usage for com.badlogic.gdx Application LOG_DEBUG

List of usage examples for com.badlogic.gdx Application LOG_DEBUG

Introduction

In this page you can find the example usage for com.badlogic.gdx Application LOG_DEBUG.

Prototype

int LOG_DEBUG

To view the source code for com.badlogic.gdx Application LOG_DEBUG.

Click Source Link

Usage

From source file:org.bladecoder.bladeengine.assets.EngineAssetManager.java

License:Apache License

protected EngineAssetManager() {
    this(new InternalFileHandleResolver());
    getLogger().setLevel(Application.LOG_DEBUG);
}

From source file:org.oscim.gdx.GdxMap.java

License:Open Source License

@Override
public void create() {
    mMap = new MapAdapter();
    mMapRenderer = new MapRenderer(mMap);

    Gdx.graphics.setContinuousRendering(false);
    Gdx.app.setLogLevel(Application.LOG_DEBUG);

    int w = Gdx.graphics.getWidth();
    int h = Gdx.graphics.getHeight();

    mMap.viewport().setScreenSize(w, h);
    mMapRenderer.onSurfaceCreated();/*w w  w .  j  av  a 2s. co  m*/
    mMapRenderer.onSurfaceChanged(w, h);

    InputMultiplexer mux = new InputMultiplexer();
    mux.addProcessor(new InputHandler(this));
    //mux.addProcessor(new GestureDetector(20, 0.5f, 2, 0.05f,
    //                                     new MapController(mMap)));
    mux.addProcessor(new MotionHandler(mMap));

    Gdx.input.setInputProcessor(mux);

    createLayers();
}

From source file:org.oscim.theme.comparator.vtm.MapApplicationAdapter.java

License:Open Source License

@Override
public void create() {
    map = new MapAdapter() {

        @Override/*from   w  w w .j av a 2s.co  m*/
        public void beginFrame() {
            super.beginFrame();
        }

        @Override
        public void onMapEvent(Event e, final MapPosition mapPosition) {
            super.onMapEvent(e, mapPosition);
            if (e == Map.MOVE_EVENT || e == Map.SCALE_EVENT) {
                bothMapPositionHandler.mapPositionChangedFromVtmMap(mapPosition);
            }
        }
    };
    mapRenderer = new MapRenderer(map);
    Gdx.graphics.setContinuousRendering(true);
    Gdx.app.setLogLevel(Application.LOG_DEBUG);

    int w = Gdx.graphics.getWidth();
    int h = Gdx.graphics.getHeight();

    map.viewport().setViewSize(w, h);
    mapRenderer.onSurfaceCreated();
    mapRenderer.onSurfaceChanged(w, h);

    InputMultiplexer mux = new InputMultiplexer();
    mux.addProcessor(new MotionHandler(map) {
        @Override
        public boolean scrolled(int amount) {
            super.scrolled(amount);
            MapPosition mapPosition = map.getMapPosition();
            int zoomLevel = mapPosition.getZoomLevel() - amount;
            mapPosition.setZoomLevel(zoomLevel);
            map.setMapPosition(mapPosition);
            bothMapPositionHandler.mapPositionChangedFromVtmMap(mapPosition);
            return true;
        }
    });
    mux.addProcessor(new GestureDetector(new GestureHandlerImpl(map)));

    Gdx.input.setInputProcessor(mux);

    mapScaleBar = new DefaultMapScaleBar(map);
    mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
    mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
    mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
    mapScaleBarLayer = new MapScaleBarLayer(map, mapScaleBar);
    mapScaleBarLayer.getRenderer().setPosition(GLViewport.Position.BOTTOM_LEFT);

    centerCrossLayer = new CenterCrossLayer(map);
}

From source file:scenes.Debug.java

public Debug() {
    create();
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
}

From source file:test.MyGdxJavaMain.java

License:Apache License

@Override
public void create() {
    FileHandle fileHandle = Gdx.files.internal(Constants.CONFIG);

    try {/*  w  ww .  j  av a2s  .  c o m*/
        PropertiesUtils.load(Constants.PROPERTIES, fileHandle.reader());
    } catch (IOException e) {
        e.printStackTrace();
    }

    Gdx.app.setLogLevel(Application.LOG_DEBUG);

    System.out.println(Constants.PROPERTIES.get("log.level"));
    stage = new Stage();
    batch = new SpriteBatch();
    sprite = new Sprite();
    image = new Image();
    region = new TextureRegion();

    //ImageUtils.setScreenTextureRegion(region);
    sprite.setScale(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    sprite.setRegion(region);

}

From source file:th.skyousuke.libgdx.xomaisad.XOMaiSad.java

License:Apache License

@Override
public void create() {
    batch = new SpriteBatch();
    glyphLayout = new GlyphLayout();

    Gdx.app.setLogLevel(Application.LOG_DEBUG);

    Assets.instance.init();//  w ww  .  j a  va2  s  .  c  o  m
    setScreen(new MainMenuScreen(this));
}

From source file:uk.co.lemmily.game.LibgdxUtils.java

License:Open Source License

@Override
public void create() {
    try {//  ww  w.  j  a va2s .co m
        logger.setLevel(Logger.DEBUG);
        Gdx.app.setLogLevel(Application.LOG_DEBUG);

        Texture.setAssetManager(assets);

        spriteBatch = new SpriteBatch();
        //            spriteBatch.setProjectionMatrix(new Matrix4().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
        modelBatch = new ModelBatch();

        tweenManager = new TweenManager();
        Tween.registerAccessor(Actor.class, new ActorAccessor());

        game.create();
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
        Gdx.app.exit();
    }
}

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>
 *//* ww  w . j ava 2s.  c  om*/
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);
    }
}