Camera Now you need to make 2 cameras. One for the main area and one for UI
This example is adapted from How to implement 2 cameras in a unique stage using LibGDX
mainCamera = new OrthographicCamera(GAME_WIDTH,GAME_HEIGHT);
mainCamera.position.set(GAME_WIDTH /2, GAME_HEIGHT /2, 0);
mainCamera.update();
secondCamera = new OrthographicCamera(UI_WIDTH,UI_HEIGHT);
secondCamera.position.set(UI_WIDTH /2,UI_HEIGHT /2, 0);
secondCamera.update();
In your render method you would add
//For the main cam
Gdx.gl.glViewport(0,0,GAME_WIDTH, GAME_HEIGHT); // set viewport to full screen
batch.setProjectionMatrix(mainCamera.combined);
batch.begin();
// draw main screen items
batch.end();
//For the UI cam
Gdx.gl.glViewport(100,100,300, 400); // set smaller region for UI
batch.setProjectionMatrix(secondCamera.combined);
batch.begin();
// draw UI items
batch.end();
The important bit being the glViewport which sets which part of the screen to draw to.