Esempio n. 1
0
        public EditorScreen()
            : base("Editor Screen")
        {
            TransitionOnTime = TimeSpan.FromSeconds(0.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            ExitButton = new MenuButton(new ExitButtonStyle(ScreenManager.Game.Content));
            SaveButton = new MenuButton(new SaveMapButtonStyle(ScreenManager.Game.Content));
            LoadButton = new MenuButton(new LoadMapButtonStyle(ScreenManager.Game.Content));

            BGLayerButton = new MenuButton(new BGLayerButton(ScreenManager.Game.Content));
            MiddleLayerButton = new MenuButton(new MiddleLayerBytton(ScreenManager.Game.Content));
            FGLayerButton = new MenuButton(new FGLayerButton(ScreenManager.Game.Content));

            TileLayerButton = new MenuButton(new TileLayerButton(ScreenManager.Game.Content));
            CollisionLayerButton = new MenuButton(new CollisionLayerButton(ScreenManager.Game.Content));
            JumpLayerButton = new MenuButton(new JumpLayerButton(ScreenManager.Game.Content));

            MenuEntries.Add(ExitButton);
            MenuEntries.Add(SaveButton);
            MenuEntries.Add(LoadButton);

            #region TileButtons
            ToolButtons = new List<MenuButton>();
            ToolButtons.Add(new MenuButton(new Tile0(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile1(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile2(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile3(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile4(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile5(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile6(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile7(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile8(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile9(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile10(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile11(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile12(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile13(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile14(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Tile15(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new JumpTileButton(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new GoalTileButton(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Spike1Button(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new Spike2Button(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile0(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile1(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile2(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile3(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile4(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile5(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile6(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile7(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new BGTile8(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new PlayerButton(ScreenManager.Game.Content)));
            ToolButtons.Add(new MenuButton(new EnemyButton(ScreenManager.Game.Content)));

            #endregion
        }
Esempio n. 2
0
        public void Update(List List, MenuScreen screen, GameTime gameTime)
        {
            if (List.currState.LeftButton == ButtonState.Pressed && List.oldState.LeftButton == ButtonState.Released)
            {
                Selected = false;

                if (ItemStyle.ClickableArea().Contains(List.mousePos))
                {
                    ItemStyle.Color = Color.Gray;
                    Selected = true;
                    Console.WriteLine("Selected list item: " + Text);
                }
            }
            else if (ItemStyle.ClickableArea().Contains(List.mousePos))
                ItemStyle.Color = Color.Gray;
        }
Esempio n. 3
0
        public LoadMapScreen()
            : base("")
        {
            LoadButton = new MenuButton(new LoadButtonStyle(ScreenManager.Game.Content));
            DeleteButton = new MenuButton(new DeleteButtonStyle(ScreenManager.Game.Content));
            CancelButton = new MenuButton(new CancelButtonStyle(ScreenManager.Game.Content));
            SavedMapList = new List(new LoadMapListStyle(ScreenManager.Game.Content));

            TitleTexture = ScreenManager.Game.Content.Load<Texture2D>("Editor/LoadMap/LoadLable");

            for (int i = 0; i < FileLoader.LoadedGameData.MapList.Count; i++)
            {
                SavedMapList.AddItem(FileLoader.LoadedGameData.MapList[i], new LoadMapListItemStyle(ScreenManager.Game.Content));
            }

            MenuEntries.Add(LoadButton);
            MenuEntries.Add(DeleteButton);
            MenuEntries.Add(CancelButton);
            MenuEntries.Add(SavedMapList);

            IsPopup = true;
        }
Esempio n. 4
0
 public List(ListStyle ListStyle)
 {
     this.ListStyle = ListStyle;
     ListItems = new List<ListItem>();
     selectedItem = null;
 }
Esempio n. 5
0
        public EditorScreen()
            : base("Editor Screen")
        {
            TransitionOnTime = TimeSpan.FromSeconds(0.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            EditMode = 0;

            ExitButton = new MenuButton(new ExitButtonStyle(ScreenManager.Game.Content));
            SaveButton = new MenuButton(new SaveMapButtonStyle(ScreenManager.Game.Content));
            LoadButton = new MenuButton(new LoadMapButtonStyle(ScreenManager.Game.Content));

            BGLayerButton = new MenuButton(new BGLayerButton(ScreenManager.Game.Content));
            MiddleLayerButton = new MenuButton(new MiddleLayerBytton(ScreenManager.Game.Content));
            FGLayerButton = new MenuButton(new FGLayerButton(ScreenManager.Game.Content));

            TileLayerButton = new MenuButton(new TileLayerButton(ScreenManager.Game.Content));
            CollisionLayerButton = new MenuButton(new CollisionLayerButton(ScreenManager.Game.Content));
            JumpLayerButton = new MenuButton(new JumpLayerButton(ScreenManager.Game.Content));

            ColorPicker = new ColorPicker(new ColorPickStyle(ScreenManager.Game.Content));

            MenuEntries.Add(ExitButton);
            MenuEntries.Add(SaveButton);
            MenuEntries.Add(LoadButton);

            #region TileButtons
            ToolButtons = new List<MenuButton>();
            //ToolButtons.Add(new MenuButton(new Tile0(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile1(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile2(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile3(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile4(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile5(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile6(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile7(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile8(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile9(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile10(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile11(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile12(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile13(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile14(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Tile15(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new JumpTileButton(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new GoalTileButton(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Spike1Button(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new Spike2Button(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile0(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile1(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile2(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile3(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile4(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile5(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile6(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile7(ScreenManager.Game.Content)));
            //ToolButtons.Add(new MenuButton(new BGTile8(ScreenManager.Game.Content)));

            //ToolButtons.Add(new MenuButton(new EnemyButton(ScreenManager.Game.Content)));

            #endregion

            for (int i = 0; i < 56; i++)
            {
                int x = i % 8;
                int y = i / 8;

                ToolButtons.Add(new MenuButton(new DynamicTileButton(x, y, 40, ScreenManager.Game.Content)));
            }

            ToolButtons.Add(new MenuButton(new PlayerButton(ScreenManager.Game.Content)));
        }