Example usage for com.badlogic.gdx.utils.viewport Viewport getBottomGutterHeight

List of usage examples for com.badlogic.gdx.utils.viewport Viewport getBottomGutterHeight

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils.viewport Viewport getBottomGutterHeight.

Prototype

public int getBottomGutterHeight() 

Source Link

Document

Returns the bottom gutter (black bar) height in screen coordinates.

Usage

From source file:com.kasetagen.game.bubblerunner.screen.BubbleRunnerMenu.java

License:Creative Commons License

@Override
public void render(float delta) {
    stage.act(delta);/*  w w  w  .  j a va2 s .  c  o  m*/

    if (Gdx.graphics.isFullscreen()) {
        Viewport vp = stage.getViewport();
        int screenW = vp.getScreenWidth();
        int screenH = vp.getScreenHeight();
        int leftCrop = vp.getLeftGutterWidth();
        int bottomCrop = vp.getBottomGutterHeight();
        int xPos = leftCrop;
        int yPos = bottomCrop;

        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        Gdx.gl.glViewport(xPos, yPos, screenW, screenH);
    }
    stage.draw();
}