All Projects → davidfig → pixi-ease

davidfig / pixi-ease

Licence: MIT license
pixi.js animation library using easing functions

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pixi-ease

split-ease
The JavaScript Easing function with a beginning, middle and end
Stars: ✭ 55 (-38.89%)
Mutual labels:  ease, easing
React Move
React Move | Beautiful, data-driven animations for React
Stars: ✭ 6,395 (+7005.56%)
Mutual labels:  animate, easing
D Zone
An ambient life simulation driven by user activity within a Discord server
Stars: ✭ 466 (+417.78%)
Mutual labels:  pixi
Pixi Sound
WebAudio API playback library, with filters. Modern audio playback for modern browsers.
Stars: ✭ 201 (+123.33%)
Mutual labels:  pixi
React Pixi
Write PIXI apps using React declarative style
Stars: ✭ 1,031 (+1045.56%)
Mutual labels:  pixi
Pixi Live2d
Display live2D model as a sprite in pixi.js.
Stars: ✭ 537 (+496.67%)
Mutual labels:  pixi
Pixi Seed
Pixi.js project seed with ES6 and webpack
Stars: ✭ 149 (+65.56%)
Mutual labels:  pixi
Free Tex Packer
Free texture packer
Stars: ✭ 337 (+274.44%)
Mutual labels:  pixi
SwiftTweener
A pure Swift animation engine.
Stars: ✭ 74 (-17.78%)
Mutual labels:  easing
Pixi.js
The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.
Stars: ✭ 34,982 (+38768.89%)
Mutual labels:  pixi
Gown.js
UI system for pixi.js inspired by feathers-ui
Stars: ✭ 195 (+116.67%)
Mutual labels:  pixi
Pixi Js Starter Kit
Experiment starter kit using Pixi.js, TweenMax & Webpack
Stars: ✭ 6 (-93.33%)
Mutual labels:  pixi
React Pixi Fiber
Write PixiJS applications using React declarative style.
Stars: ✭ 568 (+531.11%)
Mutual labels:  pixi
Pixi Haxe
Externs of Pixi.js for Haxe
Stars: ✭ 175 (+94.44%)
Mutual labels:  pixi
Pixi Viewport
A highly configurable viewport/2D camera designed to work with pixi.js
Stars: ✭ 532 (+491.11%)
Mutual labels:  pixi
Pixieditor
PixiEditor is a lightweight pixel art editor made with .NET 5
Stars: ✭ 210 (+133.33%)
Mutual labels:  pixi
Webosu
➤⓵ web rhythm game (unofficial osu!) http://osugame.online/
Stars: ✭ 434 (+382.22%)
Mutual labels:  pixi
Bemuse
⬤▗▚▚▚ Web-based online rhythm action game. Based on HTML5 technologies, React, Redux and Pixi.js.
Stars: ✭ 773 (+758.89%)
Mutual labels:  pixi
Pixi Cull
a library to visibly cull objects designed to work with pixi.js
Stars: ✭ 51 (-43.33%)
Mutual labels:  pixi
vue-animate-onscroll
A simple component that animates elements as they scroll into view.
Stars: ✭ 89 (-1.11%)
Mutual labels:  animate

pixi-ease

a simple and powerful pixi.js easing/tweening/animating library

features

  • ease any pixi.js parameter, including tint (using a blend function or stepped)
  • use any Penner function by name or any user-defined function
  • support for generic number parameters
  • change scale or skew using one parameter (e.g., scale: 5 changes both scale.x and scale.y)
  • set default durations and easing function for all eases
  • uses eventemitter3 for events for both the easing lists and individual eases
  • tracks eases on DisplayObject and cleans up when DisplayObject is destroyed
  • includes a default easing list so you don't have to instantiate for simple cases
  • includes a shake parameter
  • good test coverage

Live Demo

https://davidfig.github.io/pixi-ease/

Migrating to v3

  • changed default update loop to use requestAnimationFrame to remove the dependency on pixi.js
  • to use PIXI.Ticker (like in v2), pass new Ease({ ticker: PIXI.Ticker.shared })
  • ordinary usage should be unchanged

Installation

yarn add pixi-ease

or grab the latest release and use it:

<script src="/directory-to-file/pixi.js"></script>
<script src="/directory-to-file/pixi-ease.js"></script>
<!-- or <script type="module" src="https://github.com/directory-to-file/pixi-ease.es.js"></script> -->
<script>
    const ease = new Ease.Ease(options)
    Ease.add(...)
    // or Ease.ease.add(...)
</script> 

API Documentation

https://davidfig.github.io/pixi-ease/jsdoc/

Simple Usage

import * as PIXI from 'pixi.js'
import { Ease, ease } from 'pixi-ease'

const app = new PIXI.Application()
const test = app.stage.addChild(new PIXI.Sprite(PIXI.Texture.WHITE))
test.tint = 0x00ff00

const example = ease.add(test, { x: 20, y: 15, alpha: 0.25, rotation: 20, scale: 5, skewX: 0.25, blend: 0xff0000 } }, { reverse: true, duration: 2500, ease: 'easeInOutQuad' })
example.on('each', () => console.log('ease updated object during frame using PIXI.Ticker.'))
example.once('complete', () => console.log('move ease complete.'))

test.generic = 25
const generic = ease.add(test, { generic: 0 }, { duration: 1500, ease: 'easeOutQuad' })
generic.on('each', () => console.log(test.generic))

const secondEase = new Ease({ duration: 3000, wait: 1500, ease: 'easeInBack', repeat: 3 })
const test2 = app.stage.addChild(new PIXI.Sprite(PIXI.Texture.WHITE))
secondEase.add(test2, { tint: [0xff0000, 0x00ff00, 0x000ff], scaleX: 2 })

Build Examples

I've included a bunch of build examples in the builds directory, including: browserify, rollup, standalone (e.g., cdn), standalone (pixi.js v4), and typescript.

Tests

  1. Clone repository
  2. yarn install
  3. yarn test (for Mocha test code)
  4. yarn coverage (for Instanbul coverage)

To run demo locally:

  1. Clone repository
  2. yarn install
  3. yarn build
  4. yarn dev
  5. open browser to http://localhost:10001

To run build examples:

  1. Clone repository
  2. yarn install
  3. yarn build
  4. yarn builds
  5. yarn test-builds
  6. open browser to http://localhost:5000

Other Libraries

If you liked pixi-ease, please try my other open source libraries:

  • pixi-viewport - A highly configurable viewport/2D camera designed to work with pixi.js.
  • pixi-scrollbox - pixi.js scrollbox: a masked box that can scroll vertically or horizontally with scrollbars (uses pixi-ease)
  • intersects - a simple collection of 2d collision/intersects functions. Supports points, circles, lines, axis-aligned boxes, and polygons

License

MIT License (c) 2019 YOPEY YOPEY LLC by David Figatner

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].