1681-engine / pixel / SwayProp
Class: SwayProp ​
Defined in: src/pixel/SwayProp.ts:71
One sprite swaying in the wind, in whole world pixels. The placed image becomes the rig's first (largest) still piece — so whatever culls, fades or sorts it keeps working — and the other pieces and the strips are sprites beside it in the same parent, at its depth, following its visibility and alpha. A strip's sprite is moved only when its whole-pixel offset changes.
Constructors ​
Constructor ​
new SwayProp(
img,
def,
options?
): SwayProp;Defined in: src/pixel/SwayProp.ts:81
Parameters ​
| Parameter | Type |
|---|---|
img | Image |
def | SwayDef |
options | SwayPropOptions |
Returns ​
SwayProp
Properties ​
active ​
readonly active: boolean;Defined in: src/pixel/SwayProp.ts:79
False when the frame is too small or the rig has nothing to move: update then does nothing.
Methods ​
destroy() ​
destroy(): void;Defined in: src/pixel/SwayProp.ts:142
Returns ​
void
update() ​
update(
tSec,
air,
enabled?
): void;Defined in: src/pixel/SwayProp.ts:120
tSec seconds of any steady clock; enabled false stands everything still (an ambient-effects setting).
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
tSec | number | undefined |
air | SwayWind | undefined |
enabled | boolean | true |
Returns ​
void