Ejemplo n.º 1
0
  @Override
  public void draw(SpriteBatch batch, float parentAlpha) {
    // First draw bg
    if (textureBackground != null && isBackgroundTextureActive) {
      batch.draw(textureBackground, getX(), getY(), getWidth(), getHeight());
    }

    // Then draw child actors over bg
    super.draw(batch, parentAlpha);
  }
  @Override
  public void draw(SpriteBatch batch, float parentAlpha) {
    super.draw(batch, parentAlpha);

    batch.setColor(Colors.ICS_BLUE_SEMI_TRANSPARENT);
    batch.draw(whiteSwatch, getX(), getY() - LINE_WIDTH, getWidth(), LINE_WIDTH);
    batch.draw(
        whiteSwatch,
        getX() + getWidth(),
        getY() - LINE_WIDTH,
        LINE_WIDTH,
        getHeight() + LINE_WIDTH * 2);
  }
Ejemplo n.º 3
0
  @Override
  public void render(float delta) {

    camera.update();
    game.batch.setProjectionMatrix(camera.combined);

    if (!launchSoundPlayed) {
      launchSound.play();
      launchSoundPlayed = true;
    }

    // quit game if back pressed on main menu
    if (Gdx.input.isKeyPressed(Input.Keys.BACK)) {
      Gdx.app.exit();
    }

    // don't show sign in button if signed in
    if (resolver.signedIn() && signInButton != null) {
      signInButton.setVisible(false);
    }

    if (!resolver.signedIn() && signInButton != null) {
      signInButton.setVisible(true);
    }

    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    backGround.update();

    game.batch.begin();

    backGround.draw(game.batch);
    game.batch.draw(title, 0, GameConstants.GAME_HEIGHT - title.getHeight());
    table.draw(game.batch, 1);
    game.batch.end();

    stage.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 30f));
    stage.draw();
  }
Ejemplo n.º 4
0
 @Override
 public void draw(SpriteBatch batch, float parentAlpha) {
   batch.setColor(Color.WHITE);
   super.draw(batch, parentAlpha);
 }
Ejemplo n.º 5
0
 /**
  * Metodo Draw contiene el SpriteBatch para dibujar.
  *
  * @param batch
  * @param parentAlpha
  */
 public void draw(SpriteBatch batch, float parentAlpha) {
   batch.setColor(Color.BLACK);
   super.draw(batch, parentAlpha);
 }