Trouble with the Camera2D Class

Topics: User Forum
May 18, 2013 at 9:23 PM
Hey all,

I really need some help with camera tracking. I apply the cam track like so
 cam2D.TrackingBody = player.playerBody;
 cam2D.EnableTracking = true;
But for some reason the player is not the centre of the screen?

Like so:

Player Screen shot

I have no idea why this is happening

All the best,

ASlave2Gravity
May 18, 2013 at 9:39 PM
Whoops never mind I solved it. Very silly mistake.
   graphics.PreferredBackBufferWidth =  1024;
            graphics.PreferredBackBufferHeight = 768;
            graphics.ApplyChanges();
            
            cam2D = new Cam2d(GraphicsDevice);
NOT
cam2D = new Cam2d(GraphicsDevice);
 graphics.PreferredBackBufferWidth =  1024;
            graphics.PreferredBackBufferHeight = 768;
            graphics.ApplyChanges();
            
           
As you can see it's just about creating the new cam class after a resolution change.

woo!