Java Code Examples for com.badlogic.gdx.graphics.glutils.ShapeRenderer#setAutoShapeType()

The following examples show how to use com.badlogic.gdx.graphics.glutils.ShapeRenderer#setAutoShapeType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IciclesScreen.java    From ud405 with MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    hudViewport = new ScreenViewport();
    batch = new SpriteBatch();

    font = new BitmapFont();
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport, difficulty);

    Gdx.input.setInputProcessor(this);

    topScore = 0;
}
 
Example 2
Source File: IciclesScreen.java    From ud405 with MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    hudViewport = new ScreenViewport();
    batch = new SpriteBatch();

    font = new BitmapFont();
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport, difficulty);

    Gdx.input.setInputProcessor(this);

    topScore = 0;
}
 
Example 3
Source File: IciclesScreen.java    From ud405 with MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    hudViewport = new ScreenViewport();
    batch = new SpriteBatch();

    font = new BitmapFont();
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    // TODO: Initialize icicles with the difficulty
    icicles = new Icicles(iciclesViewport);

    topScore = 0;
}
 
Example 4
Source File: IciclesScreen.java    From ud405 with MIT License 6 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    hudViewport = new ScreenViewport();
    batch = new SpriteBatch();

    font = new BitmapFont();
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);

    player = new Player(iciclesViewport);
    // TODO: Initialize icicles with the difficulty
    icicles = new Icicles(iciclesViewport, difficulty);

    topScore = 0;
}
 
Example 5
Source File: IciclesScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    player = new Player(iciclesViewport);
    icicle = new Icicle(new Vector2(Constants.WORLD_SIZE / 2, Constants.WORLD_SIZE / 2));

}
 
Example 6
Source File: IciclesScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    player = new Player(iciclesViewport);
    icicle = new Icicle(new Vector2(Constants.WORLD_SIZE / 2, Constants.WORLD_SIZE / 2));

}
 
Example 7
Source File: BallScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    Gdx.input.setInputProcessor(ball);
}
 
Example 8
Source File: BallScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    balls = new Array<BouncingBall>();
    for (int i = 0; i < BALL_COUNT; i++) {
        balls.add(new BouncingBall(viewport));
    }
    Gdx.input.setInputProcessor(this);
}
 
Example 9
Source File: GameplayScreen.java    From ud406 with MIT License 5 votes vote down vote up
@Override
public void show() {
    AssetManager am = new AssetManager();
    Assets.instance.init(am);
    level = new Level();
    batch = new SpriteBatch();
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);
}
 
Example 10
Source File: IciclesScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    // TODO: Initialize the viewport using the world size constant
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    // TODO: Initialize the ShapeRenderer
    renderer = new ShapeRenderer();

    // TODO: Set autoShapeType(true) on the ShapeRenderer
    renderer.setAutoShapeType(true);

    // TODO: Create a new Icicle in the middle of the world
    icicle = new Icicle(new Vector2(Constants.WORLD_SIZE / 2, Constants.WORLD_SIZE / 2));

}
 
Example 11
Source File: BallScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    Gdx.input.setInputProcessor(ball);
}
 
Example 12
Source File: BallScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    Gdx.input.setInputProcessor(ball);
}
 
Example 13
Source File: IciclesScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport);

}
 
Example 14
Source File: IciclesScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport);

}
 
Example 15
Source File: BubbleLevelScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    axisViewport = new FitViewport(WORLD_SIZE, WORLD_SIZE);
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    batch = new SpriteBatch();
    textViewport = new ScreenViewport();
    font = new BitmapFont();
    font.getData().setScale(TEXT_SCALE);
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
    maxAcceleration = 0;
    minAcceleration = Float.MAX_VALUE;

}
 
Example 16
Source File: AccelerometerAxesScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    axisViewport = new FitViewport(WORLD_SIZE, WORLD_SIZE);
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    batch = new SpriteBatch();
    textViewport = new ScreenViewport();
    font = new BitmapFont();
    font.getData().setScale(TEXT_SCALE);
    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
    maxAcceleration = 0;
    minAcceleration = Float.MAX_VALUE;

}
 
Example 17
Source File: BallScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
    balls = new Array<BouncingBall>();
    for (int i = 0; i < BALL_COUNT; i++) {
        balls.add(new BouncingBall(viewport));
    }
    Gdx.input.setInputProcessor(this);
}
 
Example 18
Source File: BallScreen.java    From ud405 with MIT License 5 votes vote down vote up
@Override
public void show() {
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);
    viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE);
    ball = new BouncingBall(viewport);
}
 
Example 19
Source File: CameraTool.java    From riiablo with Apache License 2.0 4 votes vote down vote up
@Override
public void create() {
  batch = new SpriteBatch();
  font = new BitmapFont();
  iso = new IsometricCamera();
  shapes = new ShapeRenderer();
  shapes.setAutoShapeType(true);
  center.set(shapes.getTransformMatrix()).translate(
      Gdx.graphics.getWidth()  / 2,
      Gdx.graphics.getHeight() / 2,
      0);
  idt.set(shapes.getProjectionMatrix());

  iso.setToOrtho(false);
  iso.offset(0, -Tile.SUBTILE_HEIGHT50);
  iso.set(0, 0);

  Gdx.gl.glClearColor(0.3f, 0.3f, 0.3f, 1.0f);

  Gdx.input.setInputProcessor(new InputAdapter() {
    @Override
    public boolean scrolled(int amount) {
      iso.zoom += (amount * 0.05);
      iso.zoom = MathUtils.clamp(iso.zoom, 0.05f, 2f);
      return super.scrolled(amount);
    }

    @Override
    public boolean keyDown(int keycode) {
      final float AMOUNT = 0.25f;
      switch (keycode) {
        case Keys.SPACE:
          iso.set(0, 0);
          break;

        case Keys.SHIFT_LEFT:
          if (Gdx.input.isTouched()) break;
          moveToCursor(AMOUNT);
          break;

        case Keys.W:
        case Keys.UP:
          iso.translate(0, -AMOUNT);
          break;

        case Keys.S:
        case Keys.DOWN:
          iso.translate(0,  AMOUNT);
          break;

        case Keys.A:
        case Keys.LEFT:
          iso.translate(-AMOUNT, 0);
          break;

        case Keys.D:
        case Keys.RIGHT:
          iso.translate( AMOUNT, 0);
          break;
      }
      return super.keyDown(keycode);
    }
  });
}
 
Example 20
Source File: IciclesScreen.java    From ud405 with MIT License 4 votes vote down vote up
@Override
public void show() {
    iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE);

    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    // TODO: Initialize the HUD viewport


    // TODO: Initialize the SpriteBatch


    // TODO: Initialize the BitmapFont


    // TODO: Give the font a linear TextureFilter


    player = new Player(iciclesViewport);
    icicles = new Icicles(iciclesViewport);

    // TODO: Set top score to zero

}