I have just finished the mouse input for my game. My “player” sprite will always look at the mouse position. I am now trying to set up a zoom and translate to center the “player” sprite. I want to have it so when the sprite moves, it will stay exactly center in the frame. I sort of have one working, but when I start moving around, the mouse part gets all screwed up. Also, I can’t get it perfectly centered in the frame. Is there some kind of formula, or do I have to eye it out.
My old atan2 function used the center of the sprite minus the mouse position to get the rotation. It worked fine when it was in the center, but when I moved around with the sprite, it got messed up.
My new atan2 function uses the center of the screen (400 x 300 in my case) minus the mouse points to get the rotation. Works fine now.