I'm currently working on a top-down twin-stick shooter for Android. I've got my player moving around and shooting, but I'm looking to add a large Bitmap background which is larger than the device screen.
I'm looking for a way to position the background at 0,0 in 'world' co-ordinates, and have the view able to pan across the background with the player. I've tried using SurfaceHolder.Callbacks, but these do not seem to play nicely with my SurfaceView class. The view currently follows the player while keeping it centred, until it reaches an edge, where it will stop and the player will continue until he hits a wall.
My current thoughts are to store an offset from view co-ordinates to world co-ordinates in the update loop, and draw the bitmap using these offsets in the draw loop. Is there a more efficient way to do this, or a different way to think about it?