Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.OrthographicCamera


    this.width = width;
    this.height = height;
    this.stretch = stretch;
    this.root = new Group("root");
    this.batch = new SpriteBatch();
    this.camera = new OrthographicCamera();
    setViewport(width, height, stretch);
  }
View Full Code Here


        m_stage.getCamera().position.x = posX;
        m_stage.getCamera().position.y = posY;
    }

    public void setZoom(float zoom) {
        OrthographicCamera o = (OrthographicCamera) m_stage.getCamera();
        o.zoom = zoom;
    }
View Full Code Here

    width = Gdx.graphics.getWidth();
    height = Gdx.graphics.getHeight();
    halfWidth = width / 2;
    halfHeight = height / 2;

    camera = new OrthographicCamera( width, height );
    camera.setToOrtho( true );

    batch = new SpriteBatch();
    batch.setProjectionMatrix( camera.projection );
    batch.setTransformMatrix( camera.view );
View Full Code Here

  @Override
  public void create() {
   
    configurationManager = new ConfigurationManager();
   
    camera = new OrthographicCamera();
    camera.setToOrtho(false, Constants.SCREEN_WIDTH, Constants.SCREEN_HEIGHT);
    camera.update();
   
    batch = new SpriteBatch();
    font = new BitmapFont();
View Full Code Here

  private final Color debugColor = new Color(0, 1, 0, 0.85f);

  /** Creates a stage with a {@link ScalingViewport} set to {@link Scaling#fill}. The stage will use its own {@link Batch} which
   * will be disposed when the stage is disposed. */
  public Stage () {
    this(new ScalingViewport(Scaling.stretch, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), new OrthographicCamera()),
      new SpriteBatch());
    ownsBatch = true;
  }
View Full Code Here

  private float minWorldWidth, minWorldHeight;
  private float maxWorldWidth, maxWorldHeight;

  /** Creates a new viewport using a new {@link OrthographicCamera} with no maximum world size. */
  public ExtendViewport (float minWorldWidth, float minWorldHeight) {
    this(minWorldWidth, minWorldHeight, 0, 0, new OrthographicCamera());
  }
View Full Code Here

  }

  /** Creates a new viewport using a new {@link OrthographicCamera} and a maximum world size.
   * @see ExtendViewport#ExtendViewport(float, float, float, float, Camera) */
  public ExtendViewport (float minWorldWidth, float minWorldHeight, float maxWorldWidth, float maxWorldHeight) {
    this(minWorldWidth, minWorldHeight, maxWorldWidth, maxWorldHeight, new OrthographicCamera());
  }
View Full Code Here

public class ScalingViewport extends Viewport {
  private Scaling scaling;

  /** Creates a new viewport using a new {@link OrthographicCamera}. */
  public ScalingViewport (Scaling scaling, float worldWidth, float worldHeight) {
    this(scaling, worldWidth, worldHeight, new OrthographicCamera());
  }
View Full Code Here

public class ScreenViewport extends Viewport {
  private float unitsPerPixel = 1;

  /** Creates a new viewport using a new {@link OrthographicCamera}. */
  public ScreenViewport () {
    this(new OrthographicCamera());
  }
View Full Code Here

  public static class MainClass extends ApplicationAdapter {
    PooledEngine engine;
   
    @Override
    public void create() {
      OrthographicCamera camera = new OrthographicCamera(640, 480);
      camera.position.set(320, 240, 0);
      camera.update();
     
      Texture crateTexture = new Texture("assets/crate.png");
      Texture coinTexture = new Texture("assets/coin.png");
     
      engine = new PooledEngine();
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.OrthographicCamera

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.