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
45
increased by4.65%
Maintainers
1
Install size
111 kB
Created
Weekly downloads
 

Readme

Source

sprinkler.jsv0.2.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
  • Money
  • Bananas

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

$ 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.

Serve with $ npm start.

Todo

  • implementation.
  • tests

Versioning

Semantic Versioning 2.0.0

License

MIT License

Keywords

FAQs

Last updated on 01 Jan 2015

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