Recommended way to set up game camera?

Hi all,

I was wondering what the recommended way to set up a camera is.

I have always used an x and y offset variable and drawn everything based off of that. So all the map objects would move as the xOffset and yOffset changes. But I recently heard that you could just use g.translate(x, y) to move the actual origin of the drawing area, which could be used for a game camera.

So, which is the standard way to set up a camera?

Thank you all very much