Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
Adding my own easing functions to javaScript library (Paper.js)

I want to extend the Paper.js library (https://github.com/paperjs/paper.js) to add my own easing functions. The full source code of the library is here: https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.12.15/paper-full.js.

However, the relevant part is this:


var Tween = Base.extend(Emitter, {
    _class: 'Tween',

    statics: {
        easings: new Base({
            linear: function(t) {
                return t;
            },

            easeInQuad: function(t) {
                return t * t;
            }
        })
    },
// More code

I know I can create a local copy of the entire source code and make the changes to the file locally to add my own custom easing functions. However, I wanted to know if there is any way to add my own easing functions without changing the original library and making changes to the other file.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You don't even have to do this because Paper.js accepts custom easing functions.
So you simply have to pass your custom easing function when creating the Tween.
Here's a simple sketch demonstrating this.

new Path.Circle({
    center: view.center,
    radius: 50,
    fillColor: 'yellow'
}).tweenTo(
    { fillColor: 'red' },
    {
        duration: 2000,
        easing: function(t) {
            return t;
        }
    }
);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda