Terraria.ModLoader.BackgroundTextureLoader.ReserveBackgroundSlot C# (CSharp) Method

ReserveBackgroundSlot() static private method

static private ReserveBackgroundSlot ( ) : int
return int
		internal static int ReserveBackgroundSlot()
		{
			int reserve = nextBackground;
			nextBackground++;
			return reserve;
		}

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Adds a texture to the list of background textures and assigns it a background texture slot.
        /// </summary>
        /// <param name="texture">The texture.</param>
        public void AddBackgroundTexture(string texture)
        {
            if (!loading)
            {
                throw new Exception("AddBackgroundTexture can only be called from Mod.Load or Mod.Autoload");
            }

            BackgroundTextureLoader.backgrounds[texture] = BackgroundTextureLoader.ReserveBackgroundSlot();
            ModContent.GetTexture(texture);
        }