phaser - v4.0.0-rc.4
    Preparing search index...
    • Snap a value to nearest grid slice, using rounding.

      Example: if you have an interval gap of 5 and a position of 12... you will snap to 10 whereas 14 will snap to 15.

      Parameters

      • value: number

        The value to snap.

      • gap: number

        The interval gap of the grid.

      • Optionalstart: number

        Optional starting offset for gap. Default 0.

      • Optionaldivide: boolean

        If true it will divide the snapped value by the gap before returning. Default false.

      Returns number