Beispiel #1
0
 public static void DisposeWorld()
 {
     if (worldMini != null)
     {
         worldMini.Dispose();
     }
     if (world != null)
     {
         world.Dispose();
     }
     world     = null;
     worldMini = null;
 }
Beispiel #2
0
        public MiniView(Rectangle location, DockType dockType, Camera mainWorldCamera) : base(location, dockType, true)
        {
            name = "MiniView";
            this.mainWorldCamera = mainWorldCamera;
            worldMini            = WorldController.worldMini;
            worldVehicles        = WorldController.world.worldVehicles;
            camera            = new Camera(containerCamera.worldCameraViewport, 1, Vector2.Zero, new Vector2((worldMini.cellsWidth * 500) - 2, (worldMini.cellsHeight * 500) - 2), true);
            camera.clampToMap = true;
            camera.setZoomIndex(zoomIndex);
            debugLabel     = new Label("DEBUG", Font.Anita12, Color.White, new Vector2(5, 20), false, "");
            drawSpriteBack = true;
            spriteBack     = GraphicsManager.GetSpriteColour(6);

            transparency        = 0.9f;
            camera.lockKeyMove  = true;
            camera.lockZoom     = true;
            spriteMainScreenBox = GraphicsManager.GetSpriteColour(8);
            AddBorder(2, Resizing.BOTH, 40);
            AddHeading(40, "Mini Map", GraphicsManager.GetSpriteFont(Font.CarterOne16), Color.White, true, false, true, true, true, GraphicsManager.GetPreBuilt(Engine.ContentStorage.PrebuiltSprite.InGameHeadingBar));
            SetSizeBounds(300, 300, 2500, 1400);
        }