I'm working on a top down RPG game using LibGDX, and am creating an Ortho.. camera for my game. However in doing so, only my tile textures render now. This is how the render code looks:
Camera initialized as new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
(note that the camera.
calls are actually in the world.update
method, I just figured I would minimize the amount of code needed on here)
Updating/Rendering:
camera.position.set(getPlayer().getPosition().x, getPlayer().getPosition().y, 0);
camera.update();
batch.setProjectionMatrix(world.getCamera().combined);
batch.begin();
world.render(batch);
batch.end();
the world's render method ends up calling this:
public void render(SpriteBatch batch, float x, float y, float w, float h) {
batch.draw(region, x, y, w, h);
}
Where region
is a TextureRegion
Without the camera, it all works just fine, so I am very confused as to why textures only render in order now (my tile textures are rendered below entities) Does anyone have any idea why this might be? In case you want to see more code, I also have this on my github: CLICK HERE