Example #1
0
        public EditableMap(int side, MouseRectangle mouse, List<Rectangle> tiles, List<string> tileIDs, int windowWidth, int windowHeight, bool XML, EditableSquare[][] grid)
        {
            this.side = side;
            this.mouse = mouse;
            mapGrid = new EditableSquare[side][];

            if (!XML)
            {
                for (int y = 0; y < side; y++)
                {
                    mapGrid[y] = new EditableSquare[side];
                    for (int x = 0; x < side; x++)
                    {
                        //mapGrid[y][x] = new EditableSquare(x * 32, y * 32, 32, 32, tiles[0], mouse, tileIDs[0]);
                        mapGrid[y][x] = new EditableSquare(x * 32, y * 32, 32, 32, tiles[0], mouse, tileIDs[0]);
                    }
                }

            }
            else
            {
                mapGrid = grid;
            }
            options = new TextureHolder[tiles.Count];

            for (int y = 0; y < tiles.Count; y++)
            {
                options[y] = new TextureHolder(windowWidth - 32, y * 32, 32, 32, tiles[y], mouse, tileIDs[y]);
            }
        }
Example #2
0
 /// <summary>
 /// Mouse takes the texture of a TextureHolder that it's given.
 /// Should be called by textureholder if intersected by mouse.
 /// </summary>
 /// <param name="t"></param>
 public void TakeTexture(TextureHolder t)
 {
     sourceRec = t.SourceRec;
         tileID = t.TileID;
 }