List of usage examples for com.badlogic.gdx.graphics GLCommon glClear
public void glClear(int mask);
From source file:airfoil.Main.java
License:Open Source License
@Override public void render() { if (this.alive) { GLCommon gl = Gdx.gl; gl.glViewport(0, 0, this.width, this.height); gl.glClearColor(ColorClear.r, ColorClear.g, ColorClear.b, ColorClear.a); gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glEnable(GL20.GL_DEPTH_TEST); gl.glDepthFunc(GL20.GL_LESS);//from w w w .ja v a 2 s.c o m /* */ this.renderMeshLines(this.database.getMesh(this.geometry)); } }
From source file:app.badlogicgames.superjumper.GameScreen.java
License:Apache License
public void draw() { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); renderer.render();/* ww w. ja va 2 s . c o m*/ guiCam.update(); batcher.setProjectionMatrix(guiCam.combined); batcher.enableBlending(); batcher.begin(); switch (state) { case GAME_READY: presentReady(); break; case GAME_RUNNING: presentRunning(); break; case GAME_PAUSED: presentPaused(); break; case GAME_LEVEL_END: presentLevelEnd(); break; case GAME_OVER: presentGameOver(); break; } batcher.end(); }
From source file:app.badlogicgames.superjumper.HelpScreen.java
License:Apache License
public void draw() { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update();/*from w w w .j ava2s.c om*/ batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(helpRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.arrow, 320, 0, -64, 64); batcher.end(); gl.glDisable(GL10.GL_BLEND); }
From source file:app.badlogicgames.superjumper.HighscoresScreen.java
License:Apache License
public void draw() { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update();//from w w w. j a v a2 s . co m batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.highScoresRegion, 10, 360 - 16, 300, 33); float y = 230; for (int i = 4; i >= 0; i--) { Assets.font.draw(batcher, highScores[i], xOffset, y); y += Assets.font.getLineHeight(); } batcher.draw(Assets.arrow, 0, 0, 64, 64); batcher.end(); }
From source file:app.badlogicgames.superjumper.MainMenuScreen.java
License:Apache License
public void draw() { GLCommon gl = Gdx.gl; gl.glClearColor(1, 0, 0, 1);//from w ww .j a va2s. c o m gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update(); batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.logo, 160 - 274 / 2, 480 - 10 - 142, 274, 142); batcher.draw(Assets.mainMenu, 10, 200 - 110 / 2, 300, 110); batcher.draw(Assets.multiplayer, 160 - 64, 100, 128, 32); batcher.draw(Settings.soundEnabled ? Assets.soundOn : Assets.soundOff, 0, 0, 64, 64); batcher.end(); if (System.nanoTime() - last > 2000000000) { Gdx.app.log("SuperJumper", "version: " + Gdx.app.getVersion() + ", memory: " + Gdx.app.getJavaHeap() + ", " + Gdx.app.getNativeHeap() + ", native orientation:" + Gdx.input.getNativeOrientation() + ", orientation: " + Gdx.input.getRotation() + ", accel: " + (int) Gdx.input.getAccelerometerX() + ", " + (int) Gdx.input.getAccelerometerY() + ", " + (int) Gdx.input.getAccelerometerZ() + ", apr: " + (int) Gdx.input.getAzimuth() + ", " + (int) Gdx.input.getPitch() + ", " + (int) Gdx.input.getRoll()); last = System.nanoTime(); } }
From source file:app.badlogicgames.superjumper.multiplayer.StartMultiplayerScreen.java
License:Apache License
public void draw() { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update();//from w w w . j av a 2s .co m batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); float y = 230; for (int i = msg.length - 1; i >= 0; i--) { float width = Assets.font.getBounds(msg[i]).width; Assets.font.draw(batcher, msg[i], 160 - width / 2, y); y += Assets.font.getLineHeight(); } batcher.draw(Assets.arrow, 0, 0, 64, 64); batcher.end(); }
From source file:app.badlogicgames.superjumper.RegisterScreen.java
License:Apache License
public void draw() { GLCommon gl = Gdx.gl; gl.glClearColor(1, 0, 0, 1);/*w w w . ja v a 2 s . c o m*/ gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update(); batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.enterName, 10, 400, 128, 32); Assets.font.draw(batcher, ": " + Util.NAME, 140, 400 + Assets.font.getLineHeight()); batcher.draw(Assets.enterEmail, 10, 350, 128, 32); Assets.font.draw(batcher, ": " + Util.EMAIL, 140, 350 + Assets.font.getLineHeight()); batcher.draw(Assets.enterPass, 10, 300, 128, 32); Assets.font.draw(batcher, ": " + Util.PASSWORD, 140, 300 + Assets.font.getLineHeight()); batcher.draw(Assets.submit, 160 - 64, 100, 128, 32); Assets.font.draw(batcher, notification, 10, 50); batcher.end(); if (System.nanoTime() - last > 2000000000) { Gdx.app.log("SuperJumper", "version: " + Gdx.app.getVersion() + ", memory: " + Gdx.app.getJavaHeap() + ", " + Gdx.app.getNativeHeap() + ", native orientation:" + Gdx.input.getNativeOrientation() + ", orientation: " + Gdx.input.getRotation() + ", accel: " + (int) Gdx.input.getAccelerometerX() + ", " + (int) Gdx.input.getAccelerometerY() + ", " + (int) Gdx.input.getAccelerometerZ() + ", apr: " + (int) Gdx.input.getAzimuth() + ", " + (int) Gdx.input.getPitch() + ", " + (int) Gdx.input.getRoll()); last = System.nanoTime(); } }
From source file:com.asg.guesswhat.screens.MainMenuScreen.java
License:Apache License
public void draw(float deltaTime) { GLCommon gl = Gdx.gl; gl.glClearColor(1, 0, 0, 1);/*from w w w . j a v a 2 s. co m*/ gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update(); batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(Assets.backgroundRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.yourMove, 160 - 240 / 2, 480 - 40 - 52, 240, 52); batcher.draw(Assets.newGame, 160 - 240 / 2, 480 - 92 - 50, 240, 50); //batcher.draw(Assets.yourMove, 2, 200, 240, 50); //batcher.draw(Assets.yourMove, 2, 200, 240, 50); //batcher.draw(Assets.mainMenu, 10, 200 - 110 / 2, 300, 110); //batcher.draw(Settings.soundEnabled ? Assets.soundOn : Assets.soundOff, 0, 0, 64, 64); batcher.end(); }
From source file:com.badlogicgames.superjumper.CharScreen.java
License:Apache License
public void draw(float deltaTime) { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update();/*from ww w. j a va 2 s . c o m*/ batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(Assets.welcome, 0, 0, 512, 512); //MainMenuScreen.drawGradient(batcher, Assets.rect, 0, 0, 320, 480,Color.BLACK,Color.BLUE, false); batcher.end(); batcher.enableBlending(); batcher.begin(); ruota.draw(batcher, Assets.ruotaRegion, 512 + 128, 512 + 128); batcher.draw(Assets.choose, 0, 0, 512, 512); batcher.draw(Assets.icontext, 275, 10, 45, 45); batcher.draw(Assets.icontextback, 0, 10, 45, 45); //int len = buttons.size(); /* for (int i = 0; i < len; i++) { Button button = buttons.get(i); Texture keyFrame =Assets.lock; if(i==1)keyFrame=Assets.locked; //batcher.draw(keyFrame,button.position.x,button.position.y,145,145); }*/ for (Button button : buttons) { button.draw(batcher); } Assets.fontsmall.draw(batcher, "GO", 285, 40); stateTime = stateTime + 0.020f; TextureRegion keyFrame1 = Assets.swipeAnim.getKeyFrame(stateTime, Animation.ANIMATION_LOOPING); if (stateTime > 4) stateTime = 0; if (swipedeactive == 0) { batcher.draw(Assets.swipetext, 10, 0, 320, 256); batcher.draw(keyFrame1, 10, 0, 320, 256); } batcher.draw(Assets.backgroundRegion, bob.position.x, bob.position.y, 130, 130); batcher.draw(Assets.backgroundRegion10, bobfem.position.x, bobfem.position.y, 130, 130); batcher.draw(Assets.backgroundRegion11, bobmil.position.x - 20, bobmil.position.y, 170, 170); if (Settings.firstScore() < 20000 && state == 0) { batcher.draw(Assets.lock, bobfem.position.x - 10, bobfem.position.y + 30, 100, 100); batcher.draw(Assets.locked, bobfem.position.x - 45, bobfem.position.y - 70, 170, 150); Assets.fontsmall.draw(batcher, "need 20000 scores", guiCam.position.x - 90, guiCam.position.y - 150); } if (Settings.firstScore() < 70000 && state == 2) { batcher.draw(Assets.lock, bobmil.position.x + 26, bobmil.position.y + 30, 85, 100); batcher.draw(Assets.locked, bobmil.position.x - 18, bobmil.position.y - 70, 170, 150); Assets.fontsmall.draw(batcher, "need 70000 scores", guiCam.position.x - 90, guiCam.position.y - 150); } //batcher.draw(Assets.backgroundRegion,bob.position.x ,bob.position.y ,25, 35, 120, 150, 1, 1, 180); //batcher.draw(Assets.backgroundRegion10,bobfem.position.x ,bobfem.position.y ,25, 35, 120, 150, 1, 1, 180); batcher.end(); gl.glDisable(GL10.GL_BLEND); }
From source file:com.badlogicgames.superjumper.FirstScreen.java
License:Apache License
public void draw(float deltaTime) { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update();//from w w w . j ava 2s.c om batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(Assets.welcome, 0, 0, UI.SCREENPOSITIONX, UI.SCREENPOSITIONY); batcher.end(); batcher.enableBlending(); batcher.begin(); ruota.draw(batcher, Assets.ruotaRegion, UI.RUOTASIZE, UI.RUOTASIZE); Assets.handfontsmall.scale(-UI.FIRSTSCREENTEXTSCALE); Assets.handfontsmall.getRegion().getTexture().setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.MipMapLinearNearest); for (int i = 0; i < testo.size(); i++) testo.get(i).drawAnim(batcher); Assets.handfontsmall.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); Assets.handfontsmall.scale(UI.FIRSTSCREENTEXTSCALE); batcher.end(); gl.glDisable(GL10.GL_BLEND); }