Example usage for com.badlogic.gdx.graphics GL20 glClearColor

List of usage examples for com.badlogic.gdx.graphics GL20 glClearColor

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL20 glClearColor.

Prototype

public void glClearColor(float red, float green, float blue, float alpha);

Source Link

Usage

From source file:com.mygdx.game.superjumper.screen.MainMenuScreen.java

License:Apache License

public void draw() {
    GL20 gl = Gdx.gl;
    gl.glClearColor(1, 0, 0, 1);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    guiCam.update();/*from   w w  w .  j  a  v a 2s  .c om*/
    game.batcher.setProjectionMatrix(guiCam.combined);

    game.batcher.disableBlending();//??
    game.batcher.begin();
    game.batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480);
    game.batcher.end();

    game.batcher.enableBlending();
    game.batcher.begin();
    game.batcher.draw(Assets.logo, 160 - 274 / 2, 480 - 10 - 142, 274, 142);
    game.batcher.draw(Assets.mainMenu, 10, 200 - 110 / 2, 300, 110);
    game.batcher.draw(Settings.soundEnabled ? Assets.soundOn : Assets.soundOff, 0, 0, 64, 64);
    game.batcher.end();
}

From source file:com.mygdx.janelas.Janela.java

@Override
public void render(float f) {
    GL20 gl = Gdx.gl;
    gl.glClearColor(0, 0, 0, 0);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    camera.update();/*w  ww .  ja  va 2s  .  com*/
    estagio.act(Gdx.graphics.getDeltaTime());

    estagio.draw();
    cliques();
    for (Botao botoe : botoes) {
        botoe.foiClicado(clicado);
    }
    processa();
}

From source file:com.o2d.pkayjava.editor.view.Overlap2DScreen.java

License:Apache License

@Override
public void render(float deltaTime) {
    if (paused) {
        return;/* ww w  . j  ava 2 s . c o m*/
    }
    GL20 gl = Gdx.gl;
    gl.glClearColor(bgColor.r, bgColor.g, bgColor.b, bgColor.a);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    if (isDrawingBgLogo) {
        batch.begin();
        batch.setColor(1, 1, 1, 0.12f);
        batch.draw(bgLogo, screenSize.x / 2 - bgLogo.getWidth() / 2, screenSize.y / 2 - bgLogo.getHeight() / 2);
        batch.end();
    } else {
        if (sandboxBackUI != null)
            sandboxBackUI.render(deltaTime);
        if (engine != null) {
            engine.update(deltaTime);
        }
    }

    if (uiStage != null) {
        uiStage.act(deltaTime);
    }
    if (uiStage != null) {
        uiStage.draw();
    }
}

From source file:com.siondream.superjumper.MainMenuScreen.java

License:Apache License

public void draw() {
    GL20 gl = Gdx.gl;
    gl.glClearColor(1, 0, 0, 1);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    guiCam.update();//  w w  w  .  j  a v a  2s  .co  m
    game.batcher.setProjectionMatrix(guiCam.combined);

    game.batcher.disableBlending();
    game.batcher.begin();
    game.batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480);
    game.batcher.end();

    game.batcher.enableBlending();
    game.batcher.begin();
    game.batcher.draw(Assets.logo, 160 - 274 / 2, 480 - 10 - 142, 274, 142);
    game.batcher.draw(Assets.mainMenu, 10, 200 - 110 / 2, 300, 110);
    game.batcher.draw(Settings.soundEnabled ? Assets.soundOn : Assets.soundOff, 0, 0, 64, 64);
    game.batcher.end();
}

From source file:com.siondream.superjumper.SuperJumper.java

License:Apache License

@Override
public void render() {
    GL20 gl = Gdx.gl;
    gl.glClearColor(0.0f, 1.0f, 0.0f, 0.0f);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    super.render();
}

From source file:com.steelkiwi.patheditor.gdx.GdxApp.java

License:Apache License

@Override
public void render() {
    if (uiHandler != null) {
        uiHandler.updateMemoryInfo(getMemoryConsumption());
    }/*from  w ww. j  a va2s  .c  o  m*/

    if (screen != null) {
        screen.update(Gdx.graphics.getDeltaTime());
        screen.present(Gdx.graphics.getDeltaTime());
    } else {
        GL20 gl = Gdx.graphics.getGL20();
        gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        gl.glClearColor(0.698f, 0.698f, 0.698f, 1f);
    }
}

From source file:com.steelkiwi.patheditor.gdx.GdxScreen.java

License:Apache License

@Override
public void present(float deltaTime) {
    GL20 gl = Gdx.graphics.getGL20();
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    gl.glClearColor(0.698f, 0.698f, 0.698f, 1f);

    camera.update();// w  ww  . j av  a 2  s  .  c  o  m
    bgDrawer.presentFakeBG(screenW, screenH, camera.combined);

    stage.act(deltaTime);
    stage.draw();

    bgDrawer.presentOverlayBG(screenW, screenH, (int) camera.position.x, (int) camera.position.y,
            (int) camera.viewportWidth, (int) camera.viewportHeight, stage.getSpriteBatch());

    if (splineBuilder != null) {
        splineBuilder.present(camera.combined);
    }
}

From source file:com.uwsoft.editor.gdx.screen.Overlap2DScreen.java

License:Apache License

@Override
public void render(float deltaTime) {
    if (paused) {
        return;//from   www  .  j  a v a 2s  .c  o m
    }
    GL20 gl = Gdx.gl;
    gl.glClearColor(0.129f, 0.129f, 0.129f, 1.0f);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    sandboxStage.act(deltaTime);
    sandboxStage.draw();

    uiStage.act(deltaTime);
    uiStage.draw();
}

From source file:com.uwsoft.editor.view.Overlap2DScreen.java

License:Apache License

@Override
public void render(float deltaTime) {
    if (paused) {
        return;/*from w  w w  .  j  av a2  s .c o  m*/
    }
    GL20 gl = Gdx.gl;
    gl.glClearColor(bgColor.r, bgColor.g, bgColor.b, bgColor.a);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    if (isDrawingBgLogo) {
        batch.begin();
        batch.setColor(1, 1, 1, 0.12f);
        batch.draw(bgLogo, screenSize.x / 2 - bgLogo.getWidth() / 2, screenSize.y / 2 - bgLogo.getHeight() / 2);
        batch.end();
    } else {
        if (sandboxBackUI != null)
            sandboxBackUI.render(deltaTime);
        engine.update(deltaTime);
    }

    uiStage.act(deltaTime);
    uiStage.draw();
}

From source file:com.wilson.game.Screen.MainMenuScreen.java

License:Apache License

public void draw() {
    GL20 gl = Gdx.gl;
    gl.glClearColor(1, 0, 0, 1);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    guiCam.update();// w w w  .  j  ava  2s  . com
    game.batcher.setProjectionMatrix(guiCam.combined);

    game.batcher.disableBlending();
    game.batcher.begin();
    game.batcher.draw(Assets.menuBackground, 0, 0, 320, 480);
    game.batcher.end();

    game.batcher.enableBlending();
    game.batcher.begin();
    game.batcher.draw(Assets.mainMenu, 67, 230 - 90 / 2, 192, 160);
    game.batcher.draw(Settings.soundEnabled ? Assets.soundOn : Assets.soundOff, 0, 0, 64, 64);
    game.batcher.end();
}