Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

JS.LensFlare

Lens Flare effect component. Relies on the Greensock TweenLite library. Not dependent on external graphical resources.

All assets are generated on the fly with pure javascript using the HTML5 Canvas element.

Current Filesize: 6KB, Compiled: 1.6KB gzipped (3.66KB uncompressed)

Blog: http://www.foumartgames.com/blog/6-JavaScript-HTML5-Canvas-Lens-Flare.html

JSfiddle Demo: https://jsfiddle.net/Foumart/mtos60jd/

Usage:

var lensCanvas = LensFlare.init(bgrImage, width, height, customLensArray, lensGenerated);

function lensGenerated(e){
	lensCanvas.play(startX, startY, destinationX, destinationY, duration, central);
}

Returns a canvas element with integrated play() method.

Global methods:

LensFlare effect initialization.

LensFlare.init(bgrImage, width, height, flaresData, generated, finished)

Generic function for drawing an image to canvas.

LensFlare.drawToCanvas(canvas, img, width, height, clear, operation, x, y, alpha)

Generic function for canvas generation.

LensFlare.generateCanvas(width, height)

About

Lens Flare effect component

Resources

License

Releases

No releases published

Packages

No packages published