Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

canvas-starfield

1.1.4 • Public • Published

canvas-starfield

A canvas rendered starfield.

Install

npm install canvas-starfield

Getting Started

 
var Starfield = require('canvas-starfield')
var sf = new Starfield({
  canvas: '#starfield-canvas', // string selector or HTML element
  numStars: 800,               // default 500
  dx: 0.05,                    // x speed of stars in px/frame, default 0.05
  dy: 0.025,                   // y speed of stars in px/frame, default 0.05
  maxRadius: 2,                // maximum star radius in px
  shootingStarInterval: 5     // time in seconds between shooting stars (omit field to disable shooting stars)
})
 
sf.start()
 

Install

npm i canvas-starfield

DownloadsWeekly Downloads

41

Version

1.1.4

License

MIT

Last publish

Collaborators

  • avatar
  • avatar