snapToIncrement
@zylem/game-lib / debug / snapToIncrement
Function: snapToIncrement()
snapToIncrement(
value,increment):number
Defined in: packages/game-lib/src/lib/core/transform-math.ts:47
Snap a value onto an absolute lattice of increment-sized steps.
Absolute rather than relative to where the drag started: the result is always a multiple of the increment, so independently placed entities line up with each other instead of each keeping its own arbitrary offset.
Parameters
value
number
increment
number
Returns
number