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

fatina-plugin-helpers

v2.0.0

Published

Fatina plugin for 2d library like Pixi.js, Phaser, ...

Downloads

26

Readme

Logo

Fatina Helpers

Small & Light tweening library for Games / Web

NPM Version NPM Downloads Build Status Coverage Status Codacy Badge License

Description

This plugin is just a set of helpers to provide a better integration of Fatina with javascript games library (pixi, phaser, ...)

This plugin requires Fatina : Here

Getting Started

Install

If you use directly the minified version

<script src="fatina-plugin-helpers.min.js"></script>

Or if you use NPM

> npm install fatina-plugin-helpers

Init

// standard node.js require
var FatinaHelpers = require('fatina-plugin-helpers');
// OR
// standard import with typescript (typed version)
import * as FatinaHelpers from 'fatina-plugin-helpers';

and initialize (add this plugin to Fatina)

Fatina.init();
Fatina.loadPlugin(FatinaHelpers.get());

Usage

You can now populate any kind of object with the following method (container, sprites, camera, ...)

Fatina.plugin.addHelpers(myObject);

Methods

Here are the helpers automatically added:

Position

Following methods use .position.x and .position.y

  • myObject.moveTo(x, y, duration) : Move to an absolute position
  • myObject.moveXTo(x, duration)
  • myObject.moveYTo(y, duration)
  • myObject.moveToRel(x, y, duration) : Move to a relative position
  • myObject.moveXToRel(x, duration)
  • myObject.moveYToRel(y, duration)
  • myObject.punchPosition(x, y, duration, iteration) : Oscillate around the current position
  • myObject.shake(x, y, duration, iteration) : Shake around the current position

Rotation

Following methods use .rotation

  • myObject.rotateTo(angle, duration) : Rotate to a specific angle in radiant (to PI/2)
  • myObject.rotateToRel(angle, duration) : Rotate by a relative radiant angle (+PI/2)
  • myObject.rotateDegTo(angle, duration) : Rotate to a specific angle in degrees (to 90°)
  • myObject.rotateDegToRel(angle, duration) : Rotate to a specific angle in degrees (+90°)
  • myObject.punchRotate(angle, duration, iteration)

Alpha

Following method use .alpha

  • myObject.fadeTo(alpha, duration) : Alpha is a float between 0 and 1 (1: fadeIn, 0: fadeOut)

Scale

Following methods use .scale.x and .scale.y

  • myObject.scaleTo(x, y, duration) : Scale to a specified value
  • myObject.scaleXTo(x, duration)
  • myObject.scaleYTo(y, duration)
  • myObject.scaleToRel(x, y, duration)
  • myObject.scaleXToRel(x, duration)
  • myObject.scaleYToRel(y, duration)
  • myObject.punchScale(x, y, duration, iteration)

Color / Tint

Following methods use .tint or .hue (the color API are slightly different between libs)

  • myObject.colorTo(r, g, b, duration) : R,G,B are float between 0-1
  • myObject.colorToRel(r, g, b, duration)
  • myObject.colorRGBTo(hex, duration) : hex is a string representation '#FFFFFF'
  • myObject.colorRGBToRel(hex, duration)
  • myObject.punchColor(r, g, b, duration, iteration)