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

tweezer

v0.0.2

Published

tweezer is an easy tweening and easing library designed primarily for use with awe6 (optional).

Downloads

14

Readme

MIT License Haxelib Version

Tweezer

Tweezer is an easy tweening and easing library designed primarily for use with awe6, the inverted game framework.

This Haxe library extends Robert Penner's easing functions to allow programmatic values to be inbetweened. Or ... "add flavor to motion"! Great for usage in game GUI transitions.

See some examples.

Usage

If using awe6:

var l_onUpdate = function( p_value:Float ):Void // The function to call back with a tween value each update
{
	// do something with p_value - e.g. change the x coordinate of a View
}
var l_startValue = 0; // The starting value (from)
var l_endValue = 100; // The ending value (to)
var l_startDelay = 500; // The intial delay before the tween begins
var l_duration = 2000; // The duration of the tween
var l_endDelay = 1000; // The final delay after the tween completes
var l_easeType = EEase.EASE_OUT; // The ease type
var l_tweenType = ETween.BOUNCE; // The tween type
var l_completeCallback = function():Void // An optional function to call on completion
{
	// do something else / chain Tweezers
}
var l_isSnap = false; // Whether values are rounded

addEntity( new Tweezer( _kernel, l_onUpdate, l_startValue, l_endValue, l_startDelay, l_duration, l_endDelay, l_easeType, l_tweenType, l_completeCallback, l_isSnap ) );

If not using awe6:

var l_startValue = 0; // The starting value (from)
var l_changeInValue = 100; // Change needed in value
var l_duration = 2000; // The duration of the tween
var l_easeType = EEase.EASE_OUT; // The ease type
var l_tweenType = ETween.BOUNCE; // The tween type

var l_currentValue = TweenFactory.createTween( l_currentTime, l_startValue, l_changeInValue, l_duration, l_easeType, l_tweenType );

Please note, for real-world implementations local variables need not be used, they are shown here for ease of explanation.

Features

The following Easing Types are included:

  • Ease In: accelerating from zero velocity
  • Ease In/Out: acceleration until halfway, then deceleration
  • Ease Out: decelerating from zero velocity
  • Ease Out/In: deceleration until halfway, then acceleration

And the following Tween Types are included:

  • Back: easing equation function for a back (overshooting cubic easing: (s+1)t^3 - st^2)
  • Bounce: easing equation function for a bounce (exponentially decaying parabolic bounce)
  • Circular: easing equation function for a circular (sqrt(1-t^2))
  • Cubic: easing equation function for a cubic (t^3)
  • Elastic: easing equation function for an elastic (exponentially decaying sine wave)
  • Exponential: easing equation function for an exponential (2^t)
  • Linear: easing equation function for a simple linear tweening
  • Quadratic: easing equation function for a quadratic (t^2)
  • Quartic: easing equation function for a quartic (t^4)
  • Quintic: easing equation function for a quintic (t^5)
  • Sine: easing equation function for a sinusoidal (sin(t))

A demo suite, to visually illustrate the various combinations of Easing and Tweeing types, is available in the demo folder. The demo uses the awe6 and createjs libraries available on haxelib and can be seen online here.