A_SetBlend

From ZDoom Wiki
Jump to: navigation, search

A_SetBlend (color blendcolor, float alpha, int duration[, color fadecolor])

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 duration, blendcolor will steadily shift to fadecolor. If fadecolor is not provided, it will instead decrease the intensity of the blending.

Duration is in tics (1/35 of a second)

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
        }
   }