A_OverlayPivot
Jump to navigation
Jump to search
A_OverlayPivot (int layer, double wx = 0.5, double wy = 0.5, int flags = 0)
Usage
Sets the position of the pivot on the overlay. This is used to set a position that will act as the center of rotation for A_OverlayRotate and A_OverlayScale. These offsets are applied on top of A_OverlayPivotAlign's settings.
This function's offsets are affected by A_OverlayFlags's PSPF_PIVOTPERCENT flag, which is set to true by default.
Parameters
- layer - The layer to modify.
- wx - Positive numbers offset to the right. Default is 0.5 (which is center if PSPF_PIVOTPERCENT is applied).
- wy - Same as `wx` but goes down if positive, up if negative instead.
- flags - Flags can be combined using '|' (without ' '):
- WOF_RELATIVE - Takes into account the current rotation of the overlay.
- WOF_ADD - The input adds instead of replaces the current offset, and implies WOF_INTERPOLATE.
- WOF_KEEPX - The 'wx' parameter is ignored.
- WOF_KEEPY - The 'wy' parameter is ignored.
- WOF_INTERPOLATE - Enables interpolation for the frame called on. For backwards compatibility however, A_OverlayOffset will override the current interpolation setting if the function is called in the same tic.
Note, despite the default values for wx and wy arguments of the function are 0.5, the default values of the corresponding vector2 pivot field in the PSprite class are 0.0, meaning the default pivot point for overlay rotation and scale is the graphic's top left corner, not its center.
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. |