예제 #1
0
        /// <summary>
        /// Loads all mapLayers onto this component.
        /// </summary>
        /// <param name="map">The reference of the tiled map that should be loaded.</param>
        /// <param name="tiledBase">A reference to the base from where the load call was made.</param>
        public new void Set(TmxMap map, TiledBase tiledBase)
        {
            base.Set(map, tiledBase);

            Layers = new TiledLayer[map.TileLayers.Count];
            for (int i = 0; i < Layers.Length; i++)
            {
                Layers[i] = new TiledLayer(tiledBase, Map, this, i);
            }
        }
예제 #2
0
        /// <summary>
        /// Loads the specified mapLayers onto this component.
        /// </summary>
        /// <param name="map">The reference of the tiled map that should be loaded.</param>
        /// <param name="tiledBase">A reference to the base from where the load call was made.</param>
        /// <param name="fromLayer">Layer to start loading from.</param>
        /// <param name="amountToLoad">How many layers to load.</param>
        public void Set(TmxMap map, TiledBase tiledBase, int fromLayer, int amountToLoad)
        {
            Set(map, tiledBase);

            // Create all layers
            Layers = new TiledLayer[amountToLoad];
            int index = -1;

            for (int i = fromLayer; i < fromLayer + amountToLoad; i++)
            {
                Layers[++index] = new TiledLayer(tiledBase, Map, this, i);
            }
        }
예제 #3
0
        /// <summary>
        /// Loads the specififed Layer onto this component.
        /// </summary>
        /// <param name="map">The reference of the tiled map that should be loaded.</param>
        /// <param name="tiledBase">A reference to the base from where the load call was made.</param>
        /// <param name="layer">Which layer to load.</param>
        public void Set(TmxMap map, TiledBase tiledBase, int layer)
        {
            Set(map, tiledBase);

            Layer = new TiledLayer(tiledBase, map, this, layer);
        }