1.1.2 • Published 3 years ago
jsnl v1.1.2
jsnl
JavaScript Noise Library
How to use
- Require
jsnl
var NL = require("jsnl").NL; // require the class
Create an instance of
NL
(with options if you are using layered Perlin noise):var NL = require("jsnl").NL; var n = new NL(45, 25); // width, height of perlin noise // or with options: var n = new NL(45, 25, { layers: 5 });
Use the function
.p()
or.lp()
to create Perlin noise or layered Perlin noise respectively```js var NL = require("jsnl").NL; var nlinstance = new NL(45, 25); var noise = nlinstance.p(); // or for layered noise var nlinstance = new NL(45, 25, { layers: 5 }); var noise = nlinstance.lp(); ```
You will be returned a list of lists, each list in the list of lists containg 1 Perlin noise number.