Overlay numbers

From ZDoom Wiki
Jump to navigation Jump to search
Any positive or negative number within the [-2147483647, 2147483647] range, with the exception of 0, can used for a layer ID. Lower numbers are drawn below higher numbers. Aside from numbers, the following constants for specific IDs already exist in GZDoom, and some of them should not be reused:
  • PSP_STRIFEHANDS (-1) — Used by the A_ItBurnsItBurns function designed for Strife. This should never be used in custom overlays or passed to A_Overlay due to special hardcoded quirks.
  • PSP_WEAPON (1) — The main layer used by the Weapon class. This should never be passed to A_Overlay. This layer should also not be destroyed, because that will make the weapon unusable and also make it impossible to switch to another weapon.
  • PSP_FLASH (1000) — Used by A_GunFlash. This layer ID can be freely used for other purposes. Also, using A_GunFlash is not obligatory, and a custom muzzle flash effect can be drawn on any layer using A_Overlay.
  • PSP_TARGETCENTER (2147483645)
  • PSP_TARGETLEFT (2147483646)
  • PSP_TARGETRIGHT (2147483647)
These three constants are used by PowerTargeter. Should not be used in custom classes.
In addition, instead of an explicit number or constant OverlayID can be passed as the layer number to make the given function act on the layer utilized by the state from which it's being called. This shouldn't be done with A_Overlay, but can be used with functions like A_OverlayFlags.