Terraria.Lighting.BlackOut C# (CSharp) Method

BlackOut() public static method

public static BlackOut ( ) : void
return void
        public static void BlackOut()
        {
            int num1 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2;
            int num2 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2;
            for (int index1 = 0; index1 < num1; ++index1)
            {
                Lighting.LightingState[] lightingStateArray = Lighting.states[index1];
                for (int index2 = 0; index2 < num2; ++index2)
                {
                    Lighting.LightingState lightingState = lightingStateArray[index2];
                    lightingState.r = 0.0f;
                    lightingState.g = 0.0f;
                    lightingState.b = 0.0f;
                }
            }
        }

Usage Example

Example #1
0
 public static void NextLightMode()
 {
     Lighting.lightCounter += 100;
     Lighting.lightMode++;
     if (Lighting.lightMode >= 4)
     {
         Lighting.lightMode = 0;
     }
     if (Lighting.lightMode == 2 || Lighting.lightMode == 0)
     {
         Main.renderCount = 0;
         Main.renderNow   = true;
         Lighting.BlackOut();
     }
 }
All Usage Examples Of Terraria.Lighting::BlackOut