How to draw in a section of the screen

So, here’s my little game frame thingy.

Basically, Where the purple/pink is, is where I want to draw my actual game.

I’m using LibGDX and I’m going to be used a TiledMap for this, but I’m not sure how to only make it draw in that section of the screen.

Any ideas? I already have the bounds for the box.

// X 150 -> 1000
// Y 720 -> 180

Just not sure on how to go about creating that area to draw in.

Make a new camera with viewport and position where you want it to be.

OrthographicCamera camera = new OrthographicCamera(850,560);
camera.setPosition(150,180);
camera.update();

Render everything you want in the purple area after you call

batch.setProjectionMatrix(camera.combined);

I don’t know if you have to flush or end the batch for this to work or if you can call it while it’s drawing.

Also, all is this is an untested idea I had while reading your problem.

Thanks, all I was missing was the set Position code.

EDIT: Got home, there’s no way to set the position of the camera

just commenting to save. love all these small fixes.

The solution given didn’t work and I’m still unable to figure this out.

What do you mean by doesnt work. Is it drawing correctly but in the wrong spot? Is it even drawing at all? In any case, you can always draw everything with a 150,180 offset

Edit:
Sorry, I forgot that you have to set the position vector directly. Use this instead to set the position.

camera.position.set(x,y);