UsePixelCoordinates() public method

Sets the camera to Orthogonal, sets the OrthogonalWidth and OrthogonalHeight to match the argument values, and can move the so the bottom-left corner of the screen is at the origin.
public UsePixelCoordinates ( bool moveCornerToOrigin, int desiredWidth, int desiredHeight ) : void
moveCornerToOrigin bool Whether the camera should be repositioned /// so the bottom left is at the origin.
desiredWidth int The desired unit width of the view.
desiredHeight int The desired unit height of the view.
return void
Ejemplo n.º 1
0
 internal static void SetupCamera(Camera cameraToSetUp, GraphicsDeviceManager graphicsDeviceManager)
 {
     #if !WINDOWS_PHONE
     FlatRedBallServices.GraphicsOptions.SetResolution(800, 600);
     #else
     graphicsDeviceManager.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
     #endif
     cameraToSetUp.UsePixelCoordinates(false, 800, 600);
 }
Ejemplo n.º 2
0
			internal static void SetupCamera (Camera cameraToSetUp, GraphicsDeviceManager graphicsDeviceManager)
			{
				#if !WINDOWS_PHONE && !WINDOWS_8 && !IOS && !ANDROID
				FlatRedBallServices.GraphicsOptions.SetResolution(800, 600);
				#endif
				#if WINDOWS_PHONE || WINDOWS_8 || IOS || ANDROID
				graphicsDeviceManager.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
				#endif
				cameraToSetUp.UsePixelCoordinates();
			}
        public void ApplyTo(Camera cameraToApplyTo)
        {
            bool isPixelPerfect2D = this.Camera.OrthogonalHeight <= 0;

            this.Camera.SetCamera(cameraToApplyTo);

            if (isPixelPerfect2D)
            {
                cameraToApplyTo.UsePixelCoordinates();
            }
        }
Ejemplo n.º 4
0
        public RenderTargetRenderer(int width, int height, bool generateMipMaps = false)
        {
            mWidth = width;
            mHeight = height;

            var device = FlatRedBallServices.GraphicsDevice;
            mRenderTarget = new RenderTarget2D(device, mWidth, mHeight,
                generateMipMaps, device.DisplayMode.Format, DepthFormat.Depth24);

            Camera = new Camera(null, mWidth, mHeight);
            Camera.UsePixelCoordinates();
            Camera.Z = 40;
            Camera.DrawsWorld = false;

        }
        public void SetCameras(Camera camera, Camera boundsCamera)
        {

            bool isPixelPerfect2D = this.Camera.OrthogonalHeight <= 0;

            this.Camera.SetCamera(camera);
            this.BoundsCamera.SetCamera(boundsCamera);

            if (isPixelPerfect2D)
            {
                camera.UsePixelCoordinates();
            }
                        

        }
Ejemplo n.º 6
0
			internal static void SetupCamera (Camera cameraToSetUp, GraphicsDeviceManager graphicsDeviceManager, int width, int height)
			{
				#if WINDOWS
				FlatRedBall.FlatRedBallServices.GraphicsOptions.SetResolution(width, height);
				#elif IOS || ANDROID
				FlatRedBall.FlatRedBallServices.GraphicsOptions.SetFullScreen(FlatRedBall.FlatRedBallServices.GraphicsOptions.ResolutionWidth, FlatRedBall.FlatRedBallServices.GraphicsOptions.ResolutionHeight);
				#endif
				#if WINDOWS_PHONE || WINDOWS_8 || IOS || ANDROID
				if (height > width)
				{
					graphicsDeviceManager.SupportedOrientations = DisplayOrientation.Portrait;
				}
				else
				{
					graphicsDeviceManager.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
				}
				#endif
				cameraToSetUp.UsePixelCoordinates();
			}
Ejemplo n.º 7
0
 internal static void SetupCamera(Camera cameraToSetUp, GraphicsDeviceManager graphicsDeviceManager)
 {
     cameraToSetUp.UsePixelCoordinates();
 }
Ejemplo n.º 8
0
 internal static void SetupCamera(Camera cameraToSetUp)
 {
     FlatRedBallServices.GraphicsOptions.SetResolution(800, 600);
     cameraToSetUp.UsePixelCoordinates(false, 400, 300);
 }
Ejemplo n.º 9
0
			internal static void SetupCamera (Camera cameraToSetUp, GraphicsDeviceManager graphicsDeviceManager, int width, int height)
			{
				cameraToSetUp.UsePixelCoordinates(false, 800, 600);
			}