Created: January 2011
Last Updated: January 2011
Original Author: Tony Huynh
Overview
The camera in FlatRedBall may be accessed via SpriteManager.Camera. The camera may use either an orthogonal projection or perspective projection. Initially, it will be in the perspective projection mode. However, it is often simpler to work with an orthogonal projective camera. Hence, it is recommended that you should switch to an orthogonal projective camera if you are making a game with only 2D elements and do not plan on using any zooming capabilities of a perspective projective camera.
Using an Orthogonal Projective Camera
Changing to an Orthogonal Projective Camera
Use the SpriteManager.Camera.UsePixelCoordinates() method to change to an orthogonal projective camera. It takes in one boolean parameter which if is set to true indicates that the lower-left corner coordinate of the screen is (0, 0) (i.e. x = 0, y = 0) or if is set to false, the center of screen is (0, 0). For example, the line SpriteManager.Camera.UsePixelCoordinates(true); will make the lower-left corner of the screen coordinate (0, 0) and the upper-right corner of the screen coordinate (<horizonal resolution>, <vertical resolution>). It is possible to change the resolution of the screen with the FlatRedBallServices.GraphicsOptions.SetResolution() method.