### Installing lazy-brush with npm (Bash) Source: https://github.com/dulnan/lazy-brush/blob/master/README.md This command installs the lazy-brush library as a dependency in your project using the npm package manager. ```bash npm install --save lazy-brush ``` -------------------------------- ### Initializing LazyBrush (JavaScript) Source: https://github.com/dulnan/lazy-brush/blob/master/README.md Creates a new instance of the LazyBrush class, configuring its behavior with a specified radius, initial enabled state, and starting point coordinates. ```javascript const lazy = new LazyBrush({ radius: 30, enabled: true, initialPoint: { x: 0, y: 0 } }) ``` -------------------------------- ### Updating Pointer Position and Getting Brush Coordinates (JavaScript) Source: https://github.com/dulnan/lazy-brush/blob/master/README.md Demonstrates how to update the pointer's position using the `update` method and retrieve the brush's current coordinates. It shows that the brush only moves when the pointer exceeds the configured radius. ```javascript // Move mouse 20 pixels to the right. lazy.update({ x: 20, y: 0 }) // Brush is not moved, because 20 is less than the radius (30). console.log(lazy.getBrushCoordinates()) // { x: 0, y: 0 } // Move mouse 40 pixels to the right. lazy.update({ x: 40, y: 0 }) // Brush is now moved by 10 pixels because 40 (mouse X) - 30 (radius) = 10. console.log(lazy.getBrushCoordinates()) // { x: 10, y: 0 } ``` -------------------------------- ### Updating Pointer Position with Friction (JavaScript) Source: https://github.com/dulnan/lazy-brush/blob/master/README.md Shows how to apply friction when updating the pointer position. Passing a friction value between 0 and 1 in the options object reduces the speed at which the brush follows the pointer. ```javascript lazy.update({ x: 40, y: 0 }, { friction: 0.5 }) ``` -------------------------------- ### Updating Pointer and Brush Simultaneously (JavaScript) Source: https://github.com/dulnan/lazy-brush/blob/master/README.md Illustrates how to update both the pointer and brush coordinates to the same point in a single call by setting the `both` option to true. This is useful for scenarios like initializing touch events. ```javascript lazy.update({ x: 40, y: 0 }, { both: true }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.