@writegames.com/game-math
    Preparing search index...

    Function snapToGrid

    • Snaps a value to the nearest grid-aligned value.

      Parameters

      • value: number

        Input vlaue

      • increment: number

        Grid size

      • offset: number = 0

        Offset to apply after the snap

      Returns number