Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Agregar mis propias funciones de aceleración a la biblioteca javaScript (Paper.js)

Quiero ampliar la biblioteca Paper.js ( https://github.com/paperjs/paper.js ) para agregar mis propias funciones de aceleración. El código fuente completo de la biblioteca está aquí: https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.12.15/paper-full.js .

Sin embargo, la parte relevante es esta:

 var Tween = Base.extend(Emitter, { _class: 'Tween', statics: { easings: new Base({ linear: function(t) { return t; }, easeInQuad: function(t) { return t * t; } }) }, // More code

Sé que puedo crear una copia local de todo el código fuente y realizar los cambios en el archivo localmente para agregar mis propias funciones de aceleración personalizadas. Sin embargo, quería saber si hay alguna forma de agregar mis propias funciones de aceleración sin cambiar la biblioteca original y realizar cambios en el otro archivo.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ni siquiera tiene que hacer esto porque Paper.js acepta funciones de aceleración personalizadas.
Por lo tanto, simplemente debe pasar su función de aceleración personalizada al crear la Tween .
Aquí hay un boceto simple que demuestra esto.

 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!