예제 #1
0
  private void initScore() {
    final float x = GAME_MARGIN_HEIGHT;
    final float y = (int) ((float) ScreenUtils.getHeight() * 0.80);
    final float w = ScreenUtils.getWidth() - GAME_MARGIN_HEIGHT * 2;
    final float h = ScreenUtils.getHeight() / 6;

    scoreComponent = new ScoreComponent(x, y, textureRegionScore, this, darkFont, this);

    scoreComponent.setSize(w, h);

    getEngine().getScene().attachChild(scoreComponent);
  }
예제 #2
0
  private void initPlate() {
    final int[] square = ScreenUtils.getSquare();

    final float x = ScreenUtils.getCenterX() - square[0] / 2 + GAME_MARGIN_WIDTH;
    final float y = ScreenUtils.getCenterY() - square[1] / 2 + GAME_MARGIN_HEIGHT;
    final float w = square[0] - GAME_MARGIN_WIDTH * 2;
    final float h = square[1] - GAME_MARGIN_HEIGHT * 2;

    plateComponent =
        new PlateComponent(x, y, plateTextureRegion, GameActivity.this, darkFont, lightFont);

    plateComponent.setSize(w, h);

    getEngine().getScene().attachChild(plateComponent);
  }
예제 #3
0
 private float getHeight(float ratio) {
   return ScreenUtils.getHeight() * ratio;
 }
예제 #4
0
 private float getWidth(float ratio) {
   return ScreenUtils.getWidth() * ratio;
 }
예제 #5
0
  private void initDimension() {
    final int widthRatio = (ScreenUtils.getWidth() - GAME_MARGIN_WIDTH * 2) / this.getColumn();
    final int heightRatio = (ScreenUtils.getHeight() - GAME_MARGIN_HEIGHT * 2) / this.getRaw();

    min = Math.min(widthRatio, heightRatio);
  }