Exemplo n.º 1
0
        public TileSetMenu(Vector2 position, TileMap tileset)
        {
            this.position = position;
            this.tileset = tileset;

            tileset.CreateNewTileSet(tileIndex);

            menu = GameUsage.tileSetMenu;

            right = new Button(GameButtons.rightTex, new Vector2(position.X + menu.Width - 32, position.Y + menu.Height - 16), GameButtons.srcRight);
            left = new Button(GameButtons.leftTex, new Vector2(position.X + 16, position.Y + menu.Height - 16), GameButtons.srcLeft);
            down = new Button(GameButtons.downTex, new Vector2(position.X + menu.Width - 16, position.Y + menu.Height - 32), GameButtons.srcDown);
            up = new Button(GameButtons.upTex, new Vector2(position.X + menu.Width - 16, position.Y + 16), GameButtons.srcUp);

            nextTileset = new Button(GameButtons.grayRightTex, new Vector2(position.X + menu.Width - 32, position.Y + 0), GameButtons.srcGrayRight);
            prevTileset = new Button(GameButtons.grayRightTex, new Vector2(position.X + 16, position.Y + 0), GameButtons.srcGrayLeft);

            right.Click += new ClickEvent(ScrollRight);
            left.Click += new ClickEvent(ScrollLeft);
            down.Click += new ClickEvent(Scrolldown);
            up.Click += new ClickEvent(Scrollup);

            nextTileset.Click += new ClickEvent(NextTileSet);
            prevTileset.Click += new ClickEvent(PrevTileSet);

            background = new MovingBackground(new Vector2(position.X + 16, position.Y + 16), GameUsage.backTile2, 16, 16, 7, 208, 80);
        }
Exemplo n.º 2
0
        public FileMenu(Vector2 position, List<TileMap> map)
        {
            this.map = map;
            this.position = position;
            this.menu = GameUsage.FileMenu;

            levelDisplay = GameUsage.levelDisplay;
            levelPos = new Vector2(position.X + 35, position.Y + 8);
            levelRect = new Rectangle(0, 0, 42, 16);

            save = GameButtons.save;
            load = GameButtons.load;
            newButton = GameButtons.newButton;

            save.position = new Vector2(position.X + 32, position.Y + 32);
            load.position = new Vector2(position.X + 32, position.Y + 52);
            newButton.position = new Vector2(position.X + 32, position.Y + 72);

            save.Click += new ClickEvent(Save);
            load.Click += new ClickEvent(Load);
            newButton.Click += new ClickEvent(New);

            nextLevel = new Button(GameButtons.grayRightTex, new Vector2(position.X + 79, position.Y + 8), GameButtons.srcGrayRight);
            prevLevel = new Button(GameButtons.grayRightTex, new Vector2(position.X + 17, position.Y + 8), GameButtons.srcGrayLeft);

            nextLevel.Click += new ClickEvent(NextLevel);
            prevLevel.Click += new ClickEvent(Prevlevel);
        }
Exemplo n.º 3
0
        public MapMenu(Vector2 position, List<TileMap> map)
        {
            this.menu = GameUsage.MapMenu;
            this.position = position;
            this.map = map;

            right = new Button(GameButtons.rightTex, new Vector2(position.X + menu.Width - 32, position.Y + menu.Height - 16), GameButtons.srcRight);
            left = new Button(GameButtons.leftTex, new Vector2(position.X + 16, position.Y + menu.Height - 16), GameButtons.srcLeft);
            down = new Button(GameButtons.downTex, new Vector2(position.X + menu.Width - 16, position.Y + menu.Height - 32), GameButtons.srcDown);
            up = new Button(GameButtons.upTex, new Vector2(position.X + menu.Width - 16, position.Y + 16), GameButtons.srcUp);

            right.Click += new ClickEvent(ScrollRight);
            left.Click += new ClickEvent(ScrollLeft);
            down.Click += new ClickEvent(Scrolldown);
            up.Click += new ClickEvent(Scrollup);

            background = new MovingBackground(new Vector2(position.X + 16, position.Y + 16), GameUsage.backTile2, 16, 16, 7, 400, 176);
        }
Exemplo n.º 4
0
        public EditMenu(Vector2 position, List<TileMap> map)
        {
            this.position = position;
            this.menu = GameUsage.EditMenu;
            this.map = map;

            // layerSwitch switching
            layer1Switch = GameButtons.layer1;
            layer2Switch = GameButtons.layer2;
            layer3Switch = GameButtons.layer3;

            layer1Switch.Click += new SwitchEvent(layer1SwitchClick);
            layer2Switch.Click += new SwitchEvent(layer2SwitchClick);
            layer3Switch.Click += new SwitchEvent(layer3SwitchClick);

            layer1Switch.pressed = true;

            layer1Switch.position = new Vector2(position.X + 52, position.Y + 28);
            layer2Switch.position = new Vector2(position.X + 52, position.Y + 50);
            layer3Switch.position = new Vector2(position.X + 52, position.Y + 72);

            // layerSwitch visible
            layerSwitch.Add(new Switch(GameButtons.layerVisible, new Vector2(position.X + 32, position.Y + 28), 16, 16)); // 0
            layerSwitch.Add(new Switch(GameButtons.layerVisible, new Vector2(position.X + 32, position.Y + 50), 16, 16)); // 1
            layerSwitch.Add(new Switch(GameButtons.layerVisible, new Vector2(position.X + 32, position.Y + 72), 16, 16)); // 2

            // buttons
            fill = GameButtons.fill;
            empty = GameButtons.empty;

            fill.position = new Vector2(position.X + 32, position.Y + 94);
            empty.position = new Vector2(position.X + 32, position.Y + 116);

            fill.Click += new ClickEvent(FillMap);
            empty.Click += new ClickEvent(EmptyMap);
        }