Esempio n. 1
0
        public ShipDesignerGameState(SpaceGame game)
            : base(game)
        {
            game.Resized += OnResized;

            Map = new ShipDesignerMap(game.Data);
            ShipDesignerMapView mapView     = new ShipDesignerMapView(Map);
            UIViewport          mapViewport = new UIViewport(96, 0, UI.Width - 96, UI.Height, mapView, game);

            mapViewport.IsAlwaysAtBottom = true;
            ShipDesignerModuleView moduleView     = new ShipDesignerModuleView(Map);
            UIViewport             moduleViewport = new UIViewport(0, 0, 96, UI.Height, moduleView, game);

            moduleViewport.IsAlwaysAtBottom = true;

            SpriteData     testSprite = game.Data.Sprites["TestIcon"];
            UIButtonSimple testButton = new UIButtonSimple(
                mapViewport.Bounds.Right - testSprite.Width * 4, mapViewport.Bounds.Bottom - testSprite.Height, testSprite.Width, testSprite.Height,
                Map.TestShip, testSprite.Base);
            //testButton.Tooltip = "Test the ship";

            SpriteData     newSprite = game.Data.Sprites["NewIcon"];
            UIButtonSimple newButton = new UIButtonSimple(
                mapViewport.Bounds.Right - newSprite.Width * 3, mapViewport.Bounds.Bottom - newSprite.Height, newSprite.Width, newSprite.Height,
                Map.NewShip, newSprite.Base);
            //newButton.Tooltip = "Create a new ship";

            SpriteData     saveSprite = game.Data.Sprites["SaveIcon"];
            UIButtonSimple saveButton = new UIButtonSimple(
                mapViewport.Bounds.Right - saveSprite.Width * 2, mapViewport.Bounds.Bottom - saveSprite.Height, saveSprite.Width, saveSprite.Height,
                Map.SaveShip, saveSprite.Base);
            //saveButton.Tooltip = "Save the current ship";

            SpriteData     loadSprite = game.Data.Sprites["LoadIcon"];
            UIButtonSimple loadButton = new UIButtonSimple(
                mapViewport.Bounds.Right - loadSprite.Width, mapViewport.Bounds.Bottom - loadSprite.Height, loadSprite.Width, loadSprite.Height,
                Map.LoadShip, loadSprite.Base);

            //loadButton.Tooltip = "Load a ship";

            UI.Add(testButton, newButton, saveButton, loadButton, moduleViewport, mapViewport);
        }
Esempio n. 2
0
 public ShipDesignerMapView(ShipDesignerMap map)
 {
     Map        = map;
     GridSprite = Map.DataManager.Sprites["PlacementGrid"];
 }
Esempio n. 3
0
 public ShipDesignerModuleView(ShipDesignerMap map)
 {
     Map = map;
 }