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:com.agateau.utils.log.GdxPrinter.java

License:Apache License

public GdxPrinter(String prefix) {
    mPrefix = prefix.isEmpty() ? "" : (prefix + ".");
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
}

From source file:com.agateau.utils.log.GdxPrinter.java

License:Apache License

@Override
public void print(int level, String tag, String message) {
    tag = mPrefix + tag;/*ww w  . j  a  v a  2s.c  o  m*/
    if (level == Application.LOG_DEBUG) {
        Gdx.app.debug(tag, message);
    } else if (level == Application.LOG_INFO) {
        Gdx.app.log(tag, message);
    } else { // LOG_ERROR
        Gdx.app.error(tag, message);
    }
}

From source file:com.agateau.utils.log.NLog.java

License:Apache License

public static void d(Object obj, Object... args) {
    print(Application.LOG_DEBUG, obj, args);
}

From source file:com.andgate.ikou.Ikou.java

License:Open Source License

@Override
public void create() {
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
    Gdx.input.setCatchBackKey(true);//from www. ja  va2s  .  c  o m
    Gdx.graphics.setVSync(true);
    screenAdjustments(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

    Gdx.gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
    Gdx.gl.glDisable(GL20.GL_CULL_FACE);

    skin = new Skin(Gdx.files.internal(Constants.SKIN_LOCATION));

    loadShader();
    loadFonts();
    loadSounds();

    setScreen(new MainMenuScreen(this));
}

From source file:com.badlogic.gdx.tests.gwt.GwtTestWrapper.java

License:Apache License

@Override
public void create() {
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
    Gdx.app.log("GdxTestGwt", "Setting up for " + tests.length + " tests.");

    ui = new Stage();
    skin = new Skin(Gdx.files.internal("data/uiskin.json"));
    font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
    container = new Table();
    ui.addActor(container);//from  ww w.  j a  v  a  2  s.co m
    container.debug();
    Table table = new Table();
    ScrollPane scroll = new ScrollPane(table);
    container.add(scroll).expand().fill();
    table.pad(10).defaults().expandX().space(4);
    for (final Instancer instancer : tests) {
        table.row();
        TextButton button = new TextButton(instancer.instance().getClass().getName(), skin);
        button.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                ((InputWrapper) Gdx.input).multiplexer.removeProcessor(ui);
                test = instancer.instance();
                Gdx.app.log("GdxTestGwt", "Clicked on " + test.getClass().getName());
                test.create();
                test.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
            }
        });
        table.add(button).expandX().fillX();
    }
    container.row();
    container.add(
            new Label("Click on a test to start it, press ESC to close it.", new LabelStyle(font, Color.WHITE)))
            .pad(5, 5, 5, 5);

    Gdx.input = new InputWrapper(Gdx.input) {
        @Override
        public boolean keyUp(int keycode) {
            if (keycode == Keys.ESCAPE) {
                if (test != null) {
                    Gdx.app.log("GdxTestGwt", "Exiting current test.");
                    dispose = true;
                }
            }
            return false;
        }

        @Override
        public boolean touchDown(int screenX, int screenY, int pointer, int button) {
            if (screenX < Gdx.graphics.getWidth() / 10.0 && screenY < Gdx.graphics.getHeight() / 10.0) {
                if (test != null) {
                    dispose = true;
                }
            }
            return false;
        }
    };
    ((InputWrapper) Gdx.input).multiplexer.addProcessor(ui);

    Gdx.app.log("GdxTestGwt", "Test picker UI setup complete.");
}

From source file:com.bladecoder.engine.util.EngineLogger.java

License:Apache License

public static void toggle() {
    if (level == Application.LOG_DEBUG)
        level = Application.LOG_ERROR;/* w w  w  . ja  v a  2  s  . co  m*/
    else
        level = Application.LOG_DEBUG;

    Gdx.app.setLogLevel(level);
}

From source file:com.bladecoder.engine.util.EngineLogger.java

License:Apache License

public static boolean debugMode() {
    if (level == Application.LOG_DEBUG)
        return true;

    return false;
}

From source file:com.bladecoder.engine.util.EngineLogger.java

License:Apache License

public static void setDebug() {
    level = Application.LOG_DEBUG;

    Gdx.app.setLogLevel(level);
}

From source file:com.cookbook.samples.client.GwtSampleWrapper.java

License:Apache License

@Override
public void create() {
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
    Gdx.app.log("GdxSampleGwt", "Setting up for " + tests.length + " tests.");

    ui = new Stage();
    skin = new Skin(Gdx.files.internal("data/uiskin.json"));
    font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
    container = new Table();
    ui.addActor(container);//from ww w.  j  ava 2 s . c  o  m
    container.debug();
    Table table = new Table();
    ScrollPane scroll = new ScrollPane(table);
    container.add(scroll).expand().fill();
    table.pad(10).defaults().expandX().space(4);
    for (final Instancer instancer : tests) {
        table.row();
        TextButton button = new TextButton(instancer.instance().getClass().getName(), skin);
        button.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                ((InputWrapper) Gdx.input).multiplexer.removeProcessor(ui);
                test = instancer.instance();
                Gdx.app.log("GdxSampleGwt", "Clicked on " + test.getClass().getName());
                test.create();
                test.setPlatformResolver(new WebResolver());
                test.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
            }
        });
        table.add(button).expandX().fillX();
    }
    container.row();
    container.add(
            new Label("Click on a test to start it, press ESC to close it.", new LabelStyle(font, Color.WHITE)))
            .pad(5, 5, 5, 5);

    Gdx.input = new InputWrapper(Gdx.input) {
        @Override
        public boolean keyUp(int keycode) {
            if (keycode == Keys.ESCAPE) {
                if (test != null) {
                    Gdx.app.log("GdxSampleGwt", "Exiting current test.");
                    dispose = true;
                }
            }
            return false;
        }

        @Override
        public boolean touchDown(int screenX, int screenY, int pointer, int button) {
            if (screenX < Gdx.graphics.getWidth() / 10.0 && screenY < Gdx.graphics.getHeight() / 10.0) {
                if (test != null) {
                    dispose = true;
                }
            }
            return false;
        }
    };
    ((InputWrapper) Gdx.input).multiplexer.addProcessor(ui);

    Gdx.app.log("GdxSampleGwt", "Test picker UI setup complete.");
}

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 ww  .  ja  v  a  2s .com
    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);
    }
}