applyPaintStroke
applyPaintStroke(
grid,stroke,baseOf):TerrainChange
Runs one Paint or Scatter stroke over the grid and returns the cells
it touched with their paint before and after. Each cell takes the
stroke once, at the strongest weight any dab reached it with, so a
slow drag and a fast one paint alike. baseOf answers a cell’s
material where the rules decide it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
grid |
PaintGrid |
stroke |
{ clear: boolean; erase: boolean; families?: ScatterFamily[]; level?: number; lower: boolean; material?: string; multiplier?: number; points: [number, number][]; radius: number; shape: "circle" | "square"; strength: number; tool: "paint" | "smooth" | "scatter" | "sculpt" | "flatten"; } |
stroke.clear |
boolean |
stroke.erase |
boolean |
stroke.families? |
ScatterFamily[] |
stroke.level? |
number |
stroke.lower |
boolean |
stroke.material? |
string |
stroke.multiplier? |
number |
stroke.points |
[number, number][] |
stroke.radius |
number |
stroke.shape |
"circle" | "square" |
stroke.strength |
number |
stroke.tool |
"paint" | "smooth" | "scatter" | "sculpt" | "flatten" |
baseOf |
(cell) => string |
Returns
Section titled “Returns”TerrainChange