Exemplo n.º 1
0
  @Override
  public void render(float delta) {
    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    logger.log();

    stage.draw();
    stage.act();
    stage.getRoot().getColor().a = 0f;

    batch.begin();

    font.draw(batch, stage.getCuvant().toUpperCase(), 15, 790);
    font.draw(batch, totalPointsStr, 420, 790);

    if (stage.eCuvant()) {
      font.setColor(Color.GREEN);
    }

    if (drawTween) {
      tweenFont.draw(batch, "+" + points, tweenFont.getX(), tweenFont.getY());
    }

    // playButton.setAlpha(0.5f);
    // batch.draw(playButton, 220, 750);

    batch.end();

    // draw the line
    shapeRend.begin(ShapeType.Line);
    shapeRend.setColor(Color.ORANGE);
    shapeRend.line(0, 745, 480, 745);
    shapeRend.end();

    manager.update(delta);

    showMenu();
  }
Exemplo n.º 2
0
  @Override
  public void show() {

    logger = new FPSLogger();
    batch = new SpriteBatch();

    // playButton = new Sprite(new Texture(Gdx.files.internal("ui/play.png")));
    // pauseButton = new Sprite(new Texture(Gdx.files.internal("ui/pause.png")));

    font = Assets.getInstance().getFont();
    tweenFont = Assets.getInstance().getFont();
    tweenFont.setColor(Color.GREEN);
    tweenFont.setX(300);
    tweenFont.setY(780);

    manager = new TweenManager();
    stage = new Scena(this);
    matriceLitere = Assets.getInstance().getMatriceLitere();

    camera = new OrthographicCamera();
    camera.position.set(480 / 2, 800 / 2, 0);
    camera.update();

    shapeRend = new ShapeRenderer();

    viewPort = new StretchViewport(480, 800);
    viewPort.setCamera(camera);
    stage.setViewport(viewPort);

    for (int i = 10; i >= 0; i--) {
      for (int j = 0; j < 7; j++) {
        stage.addActor(matriceLitere[i][j]);
      }
    }

    Gdx.input.setInputProcessor(stage);

    stage.unfocusAll();
  }
Exemplo n.º 3
0
 @Override
 public void resize(int width, int height) {
   stage.getViewport().update(width, height, false);
 }