Beispiel #1
0
        public void CreateWorldMap()
        {
            Vector2i     screenSize             = new Vector2i((int)camera.GetGUIView().Size.X, (int)camera.GetGUIView().Size.Y);
            MenuPanel    minimapPanel           = new MenuPanel(new Vector2i(0, 0), screenSize, new FloatRect(0, 0, 96, 96), 4, null, new Color(255, 255, 255, 224));
            MenuWorldMap minimap                = new MenuWorldMap(screenSize - new Vector2i(50, 50), camera, renderer);
            MenuButton   minimapPollutionToggle = new MenuButton(new Vector2i(50, 50), minimap.TogglePollution);

            minimapPanel.AttachComponent(minimap);
            minimapPanel.AttachComponent(minimapPollutionToggle);
            minimap.controllable = true;
            minimapPollutionToggle.SetInitialPosition(camera.GetGUIView());
            minimapPanel.closePanelKey = InputBindings.showWorldMap;
            minimapPanel.SetInitialPosition(camera.GetGUIView());
            minimapPanel.lockedPosition = true;
            renderer.ToggleCullingMinimap("");
            minimapPanel.ClosePanelAction = renderer.ToggleCullingMinimap;
            minimap.SetInitialPosition(camera.GetGUIView());
            menuContainer.AttachMenu(minimapPanel);
        }
Beispiel #2
0
        public void CreateMinimap()
        {
            MenuPanel    minimapPanel = new MenuPanel(new Vector2i(0, 0), new Vector2i(300, 350), new FloatRect(0, 0, 96, 96), 4, null, new Color(255, 255, 255, 224));
            MenuWorldMap minimap      = new MenuWorldMap(new Vector2i(250, 250), camera, renderer);

            minimap.mapScale = 1.25f;
            MenuButton minimapPollutionToggle = new MenuButton(new Vector2i(50, 50), minimap.TogglePollution);

            minimapPanel.AttachComponent(minimap);
            minimapPanel.AttachComponent(minimapPollutionToggle);
            minimapPollutionToggle.SetInitialPosition(camera.GetGUIView());
            minimapPanel.closePanelKey = InputBindings.showMinimap;
            minimapPanel.SetPivots("top", "right", "inside", 0);
            minimapPanel.SetInitialPosition(camera.GetGUIView());
            minimapPanel.lockedPosition = true;
            minimap.SetPivots("top", "center", "inside", 25);
            minimap.SetInitialPosition(camera.GetGUIView());
            minimapPollutionToggle.SetPivots("bottom", "center", "inside", 25);
            minimapPollutionToggle.SetInitialPosition(camera.GetGUIView());
            menuContainer.AttachMenu(minimapPanel);
        }