Socket
Socket
Sign inDemoInstall

sprinkler

Package Overview
Dependencies
0
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sprinkler

Make awesome sprite rain effects on canvas. Give a canvas and a list of image paths and start() to make it rain!


Version published
Weekly downloads
35
decreased by-2.78%
Maintainers
1
Install size
101 kB
Created
Weekly downloads
 

Readme

Source

sprinkler.jsv0.1.0

With Sprinkler you can make awesome sprite rain effects on canvas. Give it a canvas element and a list of image paths and call start() to make it rain bananas or frogs or anything you can imagine!

Examples

  • Snowfall

Usage

The following will make the canvas rain snowflakes.

var c = document.getElementById('canvas');
var s = Sprinkler.create(c);

var images = [
  'img/snowflake.png',
  'img/snowflakeb.png',
  'img/snowflakec.png'
];
s.load(images, function (start) {
  start();
});

Installation

Browsers

<script src="scripts/sprinkler.js"></script>

CommonJS & Node.js (not yet available in npm)

$ npm install sprinkler
---
> var Sprinkler = require('sprinkler');

AMD & Require.js

define(['scripts/sprinkler'], function (Sprinkler) { ... });

API

Sprinkler.create()

#load(imagePaths, callback(start, stop))

Notes for developers

Run tests with $ npm test. Build with $ npm run build.

Todo

  • implementation.
  • tests

Versioning

Semantic Versioning 2.0.0

License

MIT License

Keywords

FAQs

Last updated on 31 Dec 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc