示例#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 clsCamera(clsRoadWorld world, Vector2 target, Vector2 size, bool inputControled = false)
 {
     this.world          = world;
     this.target         = target;
     this.size           = size;
     this.inputControled = inputControled;
 }
示例#3
0
 public clsGame()
 {
     this.IsMouseVisible = true;
     roadWorld           = new clsRoadWorld(28, 64); // 64 pixels is 15 feet
     window = new clsWindow(new GraphicsDeviceManager(this), new Vector2(1536, 1024), roadWorld);
 }