/** 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()); }
/** 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()); }
/** Creates a new viewport using a new {@link OrthographicCamera}. */ public ScreenViewport () { this(new OrthographicCamera()); }
/** 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()); }
/** 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()); }
@Override public void create () { camera = new OrthographicCamera(); batch = new SpriteBatch(); long start = System.currentTimeMillis(); int glyphCount = createFonts(); long time = System.currentTimeMillis() - start; text = glyphCount + " glyphs packed in " + regions.size + " page(s) in " + time + " ms"; }
@Override public void resize (int width, int height) { float ratio = ((float)Gdx.graphics.getWidth() / (float)Gdx.graphics.getHeight()); int h = 10; int w = (int)(h * ratio); camera = new OrthographicCamera(w, h); } }
@Override public void resize (int width, int height) { float ratio = ((float)Gdx.graphics.getWidth() / (float)Gdx.graphics.getHeight()); int h = 10; int w = (int)(h * ratio); camera = new OrthographicCamera(w, h); } }
/** Creates a stage with a {@link ScalingViewport} set to {@link Scaling#stretch}. 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; }
/** Creates a stage with a {@link ScalingViewport} set to {@link Scaling#stretch}. 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; }
@Override public void create() { camera = new OrthographicCamera(); batch = new SpriteBatch(); long start = System.currentTimeMillis(); int glyphCount = createFonts(); long time = System.currentTimeMillis() - start; text = glyphCount + " glyphs packed in " + packer.getPages().size + " page(s) in " + time + " ms"; }
/** @deprecated Experimental, likely to change, do not use! */ public DirectionalShadowLight (int shadowMapWidth, int shadowMapHeight, float shadowViewportWidth, float shadowViewportHeight, float shadowNear, float shadowFar) { fbo = new FrameBuffer(Format.RGBA8888, shadowMapWidth, shadowMapHeight, true); cam = new OrthographicCamera(shadowViewportWidth, shadowViewportHeight); cam.near = shadowNear; cam.far = shadowFar; halfHeight = shadowViewportHeight * 0.5f; halfDepth = shadowNear + 0.5f * (shadowFar - shadowNear); textureDesc = new TextureDescriptor(); textureDesc.minFilter = textureDesc.magFilter = Texture.TextureFilter.Nearest; textureDesc.uWrap = textureDesc.vWrap = Texture.TextureWrap.ClampToEdge; }
/** @deprecated Experimental, likely to change, do not use! */ public DirectionalShadowLight (int shadowMapWidth, int shadowMapHeight, float shadowViewportWidth, float shadowViewportHeight, float shadowNear, float shadowFar) { fbo = new FrameBuffer(Format.RGBA8888, shadowMapWidth, shadowMapHeight, true); cam = new OrthographicCamera(shadowViewportWidth, shadowViewportHeight); cam.near = shadowNear; cam.far = shadowFar; halfHeight = shadowViewportHeight * 0.5f; halfDepth = shadowNear + 0.5f * (shadowFar - shadowNear); textureDesc = new TextureDescriptor(); textureDesc.minFilter = textureDesc.magFilter = Texture.TextureFilter.Nearest; textureDesc.uWrap = textureDesc.vWrap = Texture.TextureWrap.ClampToEdge; }
@Override public void addLight (DirectionalLight dir) { OrthographicCamera camera = new OrthographicCamera(); camera.direction.set(dir.direction); camera.near = 1; camera.far = 100; dirCameras.put(dir, new LightProperties(camera)); }
@Override public void resize (int width, int height) { w = Gdx.graphics.getWidth() / 0.8f; h = Gdx.graphics.getHeight() / 0.8f; cam = new OrthographicCamera(width, height); cam.near = 0.1f; cam.far = 10f; cam.position.set(0, 0, 0.1f); cam.direction.set(0, 0, -1f); }
@Override public void create () { Gdx.app.log("Multitouch", "multitouch supported: " + Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen)); renderer = new ShapeRenderer(); camera = new OrthographicCamera(); viewport = new ScreenViewport(camera); Gdx.input.setInputProcessor(this); }
@Override public void create () { texture = new Texture("data/stones.jpg"); batch = new SpriteBatch(); camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); controller = new CameraController(); gestureDetector = new GestureDetector(20, 40, 0.5f, 2, 0.15f, controller); Gdx.input.setInputProcessor(gestureDetector); }
@Override public void create () { world = new World(new Vector2(0, -40), true); renderer = new Box2DDebugRenderer(); cam = new OrthographicCamera(28, 20); createWorld(); Gdx.input.setInputProcessor(this); batch = new SpriteBatch(); font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false); }
@Override public void create () { float aspect = Gdx.graphics.getWidth() / (float)Gdx.graphics.getHeight(); camera = new OrthographicCamera(15 * aspect, 15); camera.update(); renderer = new ShapeRenderer(); renderer.setProjectionMatrix(camera.combined); bones = new Bone[] {new Bone("bone0", 0, 0, 0), new Bone("bone1", 0, 2, 2), new Bone("bone2", 0, 4, 2), new Bone("bone3", 0, 6, 2), new Bone("end", 0, 8, 2)}; globalCoords.set(bones[0].position); }
@Override public void create () { Pixmap pixmap = new Pixmap(16, 16, Pixmap.Format.RGBA8888); pixmap.setColor(Color.BLUE); pixmap.fill(); pixmap.setColor(Color.RED); pixmap.drawLine(0, 0, 15, 15); pixmap.drawLine(0, 15, 15, 0); tex = new Texture(pixmap); batch = new SpriteBatch(); cam = new OrthographicCamera(); cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); }