A_Overlay

Revision as of 10:39, 16 November 2023 by Jekyll Grim Payne (talk | contribs) (→‎Usage: Actually, these ARE constants)

bool A_Overlay (int layer[, state start [, bool nooverride]])

Usage

This function is a considerably expanded version of A_GunFlash, allowing users to set up multiple frames of animation for complex weaponry (dual wielding) and/or HUD elements. This can be called by more than just the weapon; a player or CustomInventory item can also call this function.

When a weapon calls this, all overlays will disappear when switching away. When called by the player or inventory items, overlays will persist until the items disappear.

To specify different behaviors for overlays, use A_OverlayFlags.

The following is a list of internal layers used by engine:

  • PSP_STRIFEHANDS (-1) - Used by A_ItBurnsItBurns in Strife.
  • PSP_WEAPON (1) - Used by the actual weapon.
  • PSP_FLASH (1000) - Used by the Flash state (see A_GunFlash).

It is recommended that all new overlays should use layers 2 on up, or -2 on down to avoid any potential problems with compatibility.

Parameters

  • layer - Indicates the draw hierarchy for the layer. Higher numbered layers will be drawn over lower numbers.
  • start - The name of the state to draw.
  • nooverride - If specified, the function will not create an overlay on an already active layer and return false. Otherwise, returns true. This can be useful for if/else statements.

Examples

  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