A_OverlayOffset [(int layer[, float x[, float y[, int flags]]]])]
Works just like A_WeaponOffset with the ability to adjust other layers, and can be called by weapons, players and inventory items. Offsets a weapon by the defined amount of x and y similar to the offset(x,y) frame keyword. This function has the following differences from the aforementioned offset ability:
- Offsets are floats, not integers.
- Offsets are not lost when firing a weapon.
- Offsets stack on top of weapon bobbing and behave independently, allowing A_WeaponReady calls to it with the WRF_NOBOB flag.
- Specifying the default coordinates does not serve as a preservative. They are absolute.
- Offsets can go beyond screen limitations.
- Because this is an action function itself, Decorate expressions can be used.
NOTE: If an overlay has PSPF_ADDWEAPON, it will inherit the weapon's offsets, which default to (0,32) if none is specified. This should be kept in mind when offsetting the overlay. Simply set it to 0 to have it follow the proper position. This does not apply to A_WeaponOffset as that strictly targets the weapon layer itself, never overlays.
- layer - The layer to adjust.
- x - Adjusts horizontal position based on positive (left) or negative (right) numbers. Default it 0.
- y - Adjusts vertical position. Default is 32. Larger values lower the weapon, and vice versa.
- flags - Flags can be combined with the | separator.
- WOF_KEEPX - x parameter will not be used.
- WOF_KEEPY - y parameter will not be used.
- WOF_ADD - Adds the current x and y parameters to the current offsets instead of overriding them.
- WOF_INTERPOLATE - Interpolates the movement from the old to the new position. Automatically implied by WOF_ADD.
|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. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.|