Add() публичный Метод

Add a new wall
public Add ( string filename, WallDir direction, Rectangle cutOut, Backend offset = null, Backend crop = null, Backend subtype = Backend.WallType.Normal ) : void
filename string
direction WallDir
cutOut Microsoft.Xna.Framework.Rectangle
offset Backend
crop Backend
subtype Backend
Результат void
Пример #1
0
        public static void CreateFloor(ContentManager _content, string name)
        {
            WallTiles tmp = new WallTiles(_content, 128, 96, "");

            tmp.Add(name, WallDir.None, new Rectangle(512, 384, 128, 96));
            tmp.Save("Content\\" + name + ".xml");

        }
Пример #2
0
        public static void CreateWalls(ContentManager _content, string name)
        {
            WallTiles _tiles = new WallTiles(_content, 128, 192, "");
            _tiles.Add(name + "a", WallDir.UpRight, new Rectangle(0, 768, 128, 192));
            _tiles.Add(name + "a", WallDir.LeftRightUp,
         new Rectangle(640, 596, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.LeftRightDown,
            new Rectangle(768, 596, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.UpDownLeft,
            new Rectangle(896, 596, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.UpDownRight,
            new Rectangle(512, 596, 128, 192), new Backend.Coords(0, 20));

            _tiles.Add(name + "a", WallDir.UpLeft, new Rectangle(128, 768, 128, 192));
            _tiles.Add(name + "a", WallDir.DownLeft, new Rectangle(256, 576, 128, 192));
            _tiles.Add(name + "a", WallDir.DownRight, new Rectangle(384, 576, 128, 192));
            _tiles.Add(name + "a", WallDir.LeftRight, new Rectangle(0, 584, 128, 184), new Backend.Coords(0, 8));
            _tiles.Add(name + "a", WallDir.UpDown, new Rectangle(128, 584, 128, 184), new Backend.Coords(0, 8));
            _tiles.Add(name + "a", WallDir.FourWay, new Rectangle(384, 768, 128, 192));
            _tiles.Add(name + "a", WallDir.RightClose, new Rectangle(256, 192, 128, 192));
            _tiles.Add(name + "a", WallDir.UpClose, new Rectangle(128, 212, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.LeftClose, new Rectangle(384, 192, 128, 192));
            _tiles.Add(name + "a", WallDir.DownClose, new Rectangle(0, 212, 128, 172), new Backend.Coords(0, 20));

            _tiles.Add(name + "a", WallDir.UpRightDiag,
            new Rectangle(566, 400, 20, 96), new Backend.Coords(54, 15), new Backend.Coords(54, 81));
            _tiles.Add(name + "a", WallDir.UpLeftDiag,
            new Rectangle(321, 20, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.DownLeftDiag,
            new Rectangle(384, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.DownRightDiag,
            new Rectangle(128, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.UpDownLeftDiag,
            new Rectangle(640, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.UpDownDiag,
            new Rectangle(0, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.FourDiag,
            new Rectangle(256, 768, 128, 192));
            _tiles.Add(name + "a", WallDir.RightCloseDiag,
            new Rectangle(149, 46, 22, 50), new Backend.Coords(53, 61), new Backend.Coords(53, 82)); // wrong size!
            _tiles.Add(name + "a", WallDir.UpCloseDiag,
            new Rectangle(257, 20, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.LeftCloseDiag,
            new Rectangle(385, 20, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.DownCloseDiag,
            new Rectangle(210, 0, 30, 192), new Backend.Coords(51, 0), new Backend.Coords(49, 0)); // Wrong size!
            _tiles.Add(name + "a", WallDir.LeftRightUpDiag,
            new Rectangle(896, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.LeftRightDownDiag,
            new Rectangle(768, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.LeftRightDiag,
            new Rectangle(256, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.UpDownRightDiag,
            new Rectangle(512, 384, 128, 192));
            _tiles.Add(name + "a", WallDir.DiagUpClose,
            new Rectangle(640, 192, 128, 192));
            _tiles.Add(name + "a", WallDir.DiagDownClose,
            new Rectangle(896, 20, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.DiagUpClose2,
            new Rectangle(512, 192, 128, 192));
            _tiles.Add(name + "a", WallDir.DiagDownClose2,
            new Rectangle(768, 20, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.DiagLeftClose,
            new Rectangle(640, 20, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.DiagRightClose,
            new Rectangle(896, 192, 128, 192));
            _tiles.Add(name + "a", WallDir.DiagLeftClose2,
            new Rectangle(512, 20, 128, 172), new Backend.Coords(0, 20));
            _tiles.Add(name + "a", WallDir.DiagRightClose2,
            new Rectangle(768, 192, 128, 192));
            _tiles.Add("Column", WallDir.Free, new Rectangle(1920, 0, 128, 192));



            _tiles.Add(name + "b", WallDir.UpLeftDiag, new Rectangle(192, 0, 64, 176), new Backend.Coords(32, 16), new Backend.Coords(32, 0), Backend.WallType.OpenDoor);
            _tiles.Add(name + "b", WallDir.UpLeftDiag, new Rectangle(128, 0, 64, 176), new Backend.Coords(32, 16), new Backend.Coords(32, 0), Backend.WallType.ClosedDoor);


            _tiles.Add(name + "b", WallDir.UpDown, new Rectangle(0, 211, 128, 172), new Backend.Coords(0, 20), null, Backend.WallType.ClosedDoor);
            _tiles.Add(name + "b", WallDir.UpDown, new Rectangle(128, 211, 128, 172), new Backend.Coords(0, 20), null, Backend.WallType.OpenDoor);


            _tiles.Add(name + "b", WallDir.LeftRight, new Rectangle(384, 211, 128, 172), new Backend.Coords(0, 20), null, Backend.WallType.OpenDoor);
            _tiles.Add(name + "b", WallDir.LeftRight, new Rectangle(256, 211, 128, 172), new Backend.Coords(0, 20), null, Backend.WallType.ClosedDoor);


            _tiles.Add(name + "b", WallDir.UpLeftDiag, new Rectangle(256, 0, 128, 192), new Backend.Coords(32, 16), new Backend.Coords(32, 0), Backend.WallType.Deco1);
            _tiles.Add(name + "b", WallDir.UpLeftDiag, new Rectangle(320, 0, 128, 192), new Backend.Coords(32, 16), new Backend.Coords(32, 0), Backend.WallType.Deco2);
            _tiles.Add(name + "b", WallDir.UpLeftDiag, new Rectangle(384, 0, 128, 192), new Backend.Coords(32, 16), new Backend.Coords(32, 0), Backend.WallType.Deco3);


            _tiles.Add(name + "b", WallDir.UpDown, new Rectangle(0, 576, 127, 191), null, new Backend.Coords(1, 1), Backend.WallType.Deco1);
            _tiles.Add(name + "b", WallDir.UpDown, new Rectangle(256, 576, 127, 191), null, new Backend.Coords(1, 1), Backend.WallType.Deco2);
            _tiles.Add(name + "b", WallDir.UpDown, new Rectangle(0, 768, 128, 192), null, null, Backend.WallType.Deco3);

            _tiles.Add(name + "b", WallDir.LeftRight, new Rectangle(128, 575, 128, 192), null, null, Backend.WallType.Deco1);
            _tiles.Add(name + "b", WallDir.LeftRight, new Rectangle(384, 576, 127, 191), null, new Backend.Coords(1, 1), Backend.WallType.Deco2);
            _tiles.Add(name + "b", WallDir.LeftRight, new Rectangle(128, 768, 128, 192), null, null, Backend.WallType.Deco3);

            _tiles.Save("Content\\" + name + ".xml");
        }