npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

LightCinematic

v1.0.1

Published

Small library for spritesheet canvas animations

Downloads

10

Readme

Build Status Coverage Status Code Climate npm version

LightCinematicTS

Light helper for animations based on spritesheets/image sequence written in Typescript.

How to use

You have mainly two objects in this small lib: - LightManager - LightCinematic

You can create a scene instantiating LightManager like:

var manager = LightManager.create({fps:25, stage: {width: 200, height:200, canvas:document.getElementById('myCanvas')}});

Create a spritesheet:

var img = new Image();
img.src = "dude_animation_sheet.png";

var sprites = LightSpritesheet.create({
			cols: 9,
			frames: {count: 9, width: 50, height: 72, src: [img]},
			loop:true,
			x: 0,
			y: 0
		});

Add add it to the manager

manager.add(sprites);

Whenever you feel ready, start the manager:

manager.start();

Light Manager Config

These are the properties you can pass to the manager:

  • fps : Frames per second which the animation will be drawn. - Default: 25
  • stage : Contains the information about your canvas dom element`
    • width : your canvas total width - Default: 300
    • height : your canvas total height - Default: 300
    • canvas : HTML Canvas element

Light Spritesheet Config

These are the properties you can pass to the spritesheet:

  • cols : Amount of columns in the spritesheet
  • frames : Contains the information about frames in the spritesheet`
    • count : total amount of frames
    • width : width of each frame
    • height : height of each frame
    • src : Array of images (if it's just one image, it will be taken as spritesheet)
  • loop : Indicates if the spritesheet must loop
  • x : x position within your canvas (Relative to 0,0)
  • y : y position within your canvas (Relative to 0,0)
  • scale : scale factor range 0 to 1

Contributing

  • You need to have Typescript transpiler installed: http://www.typescriptlang.org/
  • Set the following arguments to the compiler: --target ES5 --declaration