示例#1
0
        public clsWindow(GraphicsDeviceManager graphics, Vector2 size, clsRoadWorld world)
        {
            this.graphics = graphics;
            this.size     = size;

            this.graphics.PreferredBackBufferWidth  = (int)size.X; // set this value to the desired width of your window
            this.graphics.PreferredBackBufferHeight = (int)size.Y; // set this value to the desired height of your window
            this.graphics.ApplyChanges();

            // create cameras
            cameras = new List <clsCamera>();
            clsCamera screenCamera = new clsCamera(world, new Vector2(896, 896), new Vector2(800, 800), true);

            cameras.Add(screenCamera);

            clsCamera birdsEyeCamera = new clsCamera(world, new Vector2(896, 896), new Vector2(1700, 1700));

            cameras.Add(birdsEyeCamera);

            // create displays
            displays = new List <clsDisplay>();

            clsDisplay display = new clsDisplay(new Rectangle(200, 25, 800, 800), screenCamera, textures, fonts);

            displays.Add(display);

            display = new clsDisplay(new Rectangle(1100, 30, 250, 250), birdsEyeCamera, textures, fonts);
            displays.Add(display);
        }
示例#2
0
        public clsDisplay(Rectangle screenArea, clsCamera camera, Dictionary <string, Texture2D> textures, Dictionary <string, SpriteFont> fonts)
        {
            this.screenArea = screenArea;
            this.camera     = camera;

            this.textures = textures;
            this.fonts    = fonts;
        }