Example #1
0
		/// <summary>
		/// Constructor with size. Tiles are not initialized
		/// </summary>
		/// <param name="width">The layer width</param>
		/// <param name="height">The layer height</param>
		public LayerIso(string tilesetName, int width, int height)
		{
            _tilesetName = tilesetName;
			_tiles = new TileIso[width,height];
			_layerWidth = width;
			_layerHeight = height;
		}
Example #2
0
 /// <summary>
 /// Constructor with size. Tiles are not initialized
 /// </summary>
 /// <param name="width">The layer width</param>
 /// <param name="height">The layer height</param>
 public LayerIso(string tilesetName, int width, int height)
 {
     _tilesetName = tilesetName;
     _tiles       = new TileIso[width, height];
     _layerWidth  = width;
     _layerHeight = height;
 }
Example #3
0
		/// <summary>
		/// Create the layer from a raw data array containing only tile IDs.
		/// Heights are set to 0.
		/// </summary>
		/// <param name="data">the raw data</param>
        public LayerIso(string tilesetName, int[,] data)
        {
            _tilesetName = tilesetName;
			_layerHeight = data.GetUpperBound(0) +1;
			_layerWidth = data.GetUpperBound(1) +1;
			_tiles = new TileIso[_layerWidth,_layerHeight];
			
			for(int x = 0; x < _layerWidth; x++)
			{	
				for(int y = 0; y < _layerHeight; y++)
				{
					_tiles[x, y] = new TileIso(x, y, data[y, x]);
				}
			}
		}
Example #4
0
        /// <summary>
        /// Create the layer from a raw data array containing only tile IDs.
        /// Heights are set to 0.
        /// </summary>
        /// <param name="data">the raw data</param>
        public LayerIso(string tilesetName, int[,] data)
        {
            _tilesetName = tilesetName;
            _layerHeight = data.GetUpperBound(0) + 1;
            _layerWidth  = data.GetUpperBound(1) + 1;
            _tiles       = new TileIso[_layerWidth, _layerHeight];

            for (int x = 0; x < _layerWidth; x++)
            {
                for (int y = 0; y < _layerHeight; y++)
                {
                    _tiles[x, y] = new TileIso(x, y, data[y, x]);
                }
            }
        }
Example #5
0
 /// <summary>
 /// Get the rectangle containing the proper texture for the tile,
 /// according to it's texture ID and heights
 /// </summary>
 /// <param name="tile">The tile</param>
 /// <returns></returns>
 public static Rectangle TextureRect(TileIso tile)
 {
     return(new Rectangle());
 }
Example #6
0
		/// <summary>
		/// Get the rectangle containing the proper texture for the tile, 
		/// according to it's texture ID and heights
		/// </summary>
		/// <param name="tile">The tile</param>
		/// <returns></returns>
		public static Rectangle TextureRect(TileIso tile)
		{
			return new Rectangle();
		}