From ZDoom Wiki
Jump to navigation Jump to search

A_OverlayFlags (int layer, int flags, bool set)


Modifies an overlay's behavior, adding or subtracting flags.


  • layer - The layer to modify. This is not limited to overlays; PSP_WEAPON aka the main layer can also have its flags changed.
  • flags - Flags can be combined using '|' (without ' '):
    • PSPF_ADDWEAPON - The overlay will follow the weapon's offsets. Enabled by default. When enabled, A_OverlayOffset's X and Y values will be relative to the main weapon layer's offsets. If disabled, allows setting the overlay's offsets independently. (Note, if you disable it, your overlay's sprite will jump 32 units down because it will no longer be synced with the main layer's position, which is (0, 32) by default, while overlays use (0, 0) by default.)
    • PSPF_ADDBOB - The overlay will follow the weapon's bobbing. Enabled by default.
    • PSPF_POWDOUBLE - The overlay will have its speed doubled if a PowerDoubleFiringSpeed is active in the player's inventory.
    • PSPF_CVARFAST - The overlay will respect sv_fastweapons if enabled.
    • PSPF_FLIP - Flips the overlay on the X axis. Affects the visuals but not the position.
    • PSPF_MIRROR - Flips the offset of the overlay. Affects the position but not the visuals. Use in conjunction with PSPF_FLIP to alter the sprite's handedness. Does not imply PSPF_FLIP by itself.
    • PSPF_ALPHA - Enables alpha changing. Note, many renderstyles enforce their own alpha values, and this flag is not able to override it.
    • PSPF_FORCEALPHA - Forcefully enables alpha changing regardless of the overlay's renderstyle. PSPF_ALPHA doesn't have to be enabled for this to work.
    • PSPF_RENDERSTYLE - Enables renderstyle changing via A_OverlayRenderstyle.
    • PSPF_FORCESTYLE - Some powerup effects like the Blursphere will set all overlays to the same as the players while in effect, applying its renderstyle on the player as well. Enabling this overrides the effect for the specified layer.
    • PSPF_PLAYERTRANSLATED - Translates the overlay according to the same rules as the player's sprite. It uses the Player.ColorRange property for translation (which by default covers the green hues) and translates it according to player's settings in GZDoom.
    • PSPF_PIVOTPERCENT - When enabled, the A_OverlayPivot's XY position is based on a scalar between 0.0 (X: Left, Y: Top) to 1.0 (X: Right, Y: Bottom) of the graphic. Otherwise, the coordinates are based on coordinate offsets in pixels.
    • PSPF_INTERPOLATE - Enables interpolation constantly for the overlay. For backwards compatibility however, A_OverlayOffset called in any tic without the add and interpolate flags will temporarily disable interpolation for that tic.
  • set - If true, enables the flags on the layer. If false, disables them.


Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.

See Also