Пример #1
0
  public boolean touchDragged(int pX, int pY, int pointer) {
    float x = pX;
    float y = height - pY;

    replay.setPressed(replay.isInside(x, y));
    menu.setPressed(menu.isInside(x, y));

    return false;
  }
Пример #2
0
  public void render(float delta) {
    Gdx.gl.glClearColor(0.9f, 0.9f, 0.9f, 1);
    Gdx.gl.glClear(Gdx.gl.GL_COLOR_BUFFER_BIT);

    float font = text.getBounds(message).width;

    batch.begin();
    {
      text.draw(batch, message, (width / 2F) - (font / 2F), height - text.getCapHeight());
      replay.render(batch);
      menu.render(batch);
    }
    batch.end();
  }
Пример #3
0
  public boolean touchDown(int pX, int pY, int pointer, int button) {
    float x = pX;
    float y = height - pY;

    boolean value = false;

    if (replay.isInside(x, y)) {
      replay.setPressed(true);
      value |= true;
    }

    if (menu.isInside(x, y)) {
      replay.setPressed(true);
      value |= true;
    }

    return value;
  }
Пример #4
0
  public boolean touchUp(int pX, int pY, int pointer, int button) {
    float x = pX;
    float y = height - pY;

    boolean value = false;

    if (replay.isInside(x, y)) {
      replay.setPressed(false);
      NerdShooter.shooter.setScreen(new GameScreen(level));
      value |= true;
    }

    if (menu.isInside(x, y)) {
      menu.setPressed(false);
      NerdShooter.shooter.setScreen(StartScreen.instance);
      value |= true;
    }

    return value;
  }