A_SetBlend

From ZDoom Wiki
Jump to navigation Jump to search

A_SetBlend (color color1, double alpha, int tics [, color color2 [, double alpha2]])

Sets a palette blend effect to the calling player's screen. This function should only be used by player classes, weapons or custom inventory items. Colors are specified as an "rr gg bb" string or by using one of the color names specified in X11R6RGB lump.

Alpha defines opaqueness. An alpha of 1.0 is completely opaque, and 0.0 is completely invisible.

Over tics duration, color1 will steadily shift to color2. If color2 is not provided, it will instead decrease the intensity of the blending.

This is more or less the DECORATE equivalent of FadeRange.

Example

If you wanted to add a separate pain state for Doomguy getting zorched, and you used the "zorch" damagetype for those weapons, you could use this code to add a convincing red flash to the pain state associated with the zorch damagetype.

   actor MyDoomPlayer : DoomPlayer
   {
   	States
  	{
  	Pain.Zorch:
   		PLAY O 4 A_SetBlend("99 20 20", .5, 5)
  		PLAY O 4 A_Pain
   		Goto Spawn
        }
   }