void A_OverlayRotate (int layer, float degrees = 0, int flags = 0)
A_OverlayRotate
Availability
ZandroX only. Does not exist in Zandronum 3.2. Behaviour follows UZDoom's
A_OverlayRotate.Works in netgames. A player's client runs its own layers and takes each layer's jumps from the server — see Psprite layers.
Usage
Turns a layer about its pivot, counter-clockwise on the screen for a
positive angle. The pivot is the top left corner of the frame until
A_OverlayPivot or A_OverlayPivotAlign moves it.
PSPF_FLIP turns the other way, so a flipped layer mirrors an unflipped one.
The turn persists on the layer until changed; a state change does not reset it.
Parameters
-
int layerThe layer to turn.
0means the layer whose state is currently executing — see OverlayID. Does nothing if the layer does not exist. -
float degreesThe angle, in degrees. Default
0, upright. -
int flags- WOF_ADD — add
degreesto the layer's current turn instead of replacing it, and ease it over the tic. - WOF_INTERPOLATE — ease the change over the tic.
- WOF_ADD — add
Examples
A knife swung in an arc, turning about its handle at the bottom right of the frame:
Fire:
KNIF A 0 A_OverlayPivot(OverlayID(), 0.9, 0.9)
KNIF A 2 A_OverlayRotate(OverlayID(), 20, WOF_ADD)
KNIF A 2 A_OverlayRotate(OverlayID(), 20, WOF_ADD)
KNIF A 2 A_OverlayRotate(OverlayID(), -40, WOF_ADD)
Goto Ready
See also
- A_OverlayPivot, A_OverlayPivotAlign — the point it turns about
- A_OverlayOffset —
WOF_RELATIVEmoves a layer along its turn - Psprite layers