nature library

Classes

Drop
Drops
Droplets of liquid: arc under gravity with a little drag, drawn as a bright bead with a short tail along their motion, and land on the floor.
Gas
Puffs of gas with their own clock.
GasPuff
RockBit
SpikeDrawOpts
SpikeLook
SpikeNotch

Properties

acidSplash → PixelEffect
final
boulder → PixelEffect
final
earthSpike → PixelEffect
final
healingBloom → PixelEffect
final
leafStorm → PixelEffect
final
natureEffects → List<PixelEffect>
final
poisonCloud → PixelEffect
final
quake → PixelEffect
final
rootSnare → PixelEffect
final
sporeBurst → PixelEffect
final
thorns → PixelEffect
final
tornado → PixelEffect
final
toxicPuddle → PixelEffect
final
vineWhip → PixelEffect
final

Functions

bubble(Painter p, double x, double y, double r, int c1, int c2, int fill, [double a = 1.0, bool dome = false]) → void
A bubble of radius r centered at (x, y): a 1 px skin, a translucent belly, a white glint.
drawLeaf(Painter p, double x, double y, double len, double wid, double ang, double fl, List<int> pal, [double alpha = 1.0]) → void
A leaf len px long and wid px across at its widest, centered on (x, y), turned by ang and flipping about its midrib by fl. pal: dark, shade, body, light (dark to bright). alpha dithers it out.
drawRock(Painter p, double x, double y, double s, double a, List<Point2> pts, List<int> rampColors, [double alpha = 1.0, bool white = false]) → void
A faceted stone at (x, y): corners pts (from stoneShape) scaled by s and turned by a. Each wedge between neighbouring corners is a facet, lit by how squarely it faces the top left; edges facing the light catch a bright rim, a dark rim goes round the rest. rampColors: stone ramp, dark to bright (7+ steps). alpha dithers it out.
drawSpike(Painter p, double x, double base, double h, double w, double lean, SpikeLook sp, List<int> rampColors, [SpikeDrawOpts opts = const SpikeDrawOpts()]) → void
A faceted stone spike standing on (x, base): h tall, w wide at the base, its tip lean px over.
floorCrack(Rng r, int side, double len) → List<Point2>
A jagged floor crack from x = 0 out to side * len: points x, y, y 0..3 into the floor.
gasPuff(Painter p, double x, double y, double r, double a, int belly, int body, int cap, [int hi = 0]) → void
A puff of gas: a darker belly hanging low, a body, a denser core, a lit cap up and to the left.
spikeCrack(Rng r, double u0, double v0, int dir) → List<Point2>
A crack that branches up a spike: points u (height 0..1), v (-1 left edge..1 right edge).
spikeLook(Rng r) → SpikeLook
The random look of one spike: notches on its edges, strata across it.
stoneShape(Rng r, [int? n]) → List<Point2>
Corners of an irregular stone, unit size, in angular order.