GithubHelp home page GithubHelp logo

Choppy Animation. about limejs HOT 4 CLOSED

digitalfruit avatar digitalfruit commented on August 24, 2024
Choppy Animation.

from limejs.

Comments (4)

tonistiigi avatar tonistiigi commented on August 24, 2024

Is this the same as #22 or something else? I've seen #22 in some version of Chrome+Win.

Is it correct for you in Firefox/Safari, Windows/Mac?
If you want to track it down I would suggest switching enableOptions() and requestAnimationFrame support in schedulemanager. Also animation with easing=linear almost never looks pleasing.

I'm pretty sure this isn't a rounding error that is causing it. On Chrome this code should use CSS transitions for the animation so no calculation is made for middle steps in Javascript.

from limejs.

stringa avatar stringa commented on August 24, 2024

So, I need fast animations within my code. It seems that when you animate slowing with LimeJS, everything looks good.
But when you speed it up, it all kind of falls apart.
I'm currently doing this within my code, on 5 elements, each 4200 pixels tall.

var moveDown = new lime.animation.MoveTo(position.x, 2200)
    .setDuration(2).enableOptimizations();

var moveUp = new lime.animation.MoveTo(position.x, -2200)
    .setDuration(2).enableOptimizations();

this.runAction(new lime.animation.Loop(
   new lime.animation.Sequence(
        moveDown, //new lime.animation.Delay().setDuration(1),
        moveUp //new lime.animation.Delay().setDuration(1)
   )
));

Even when I don't specify easing, it seems that by default it's doing an EASEINOUT.
I'm starting to think it's in the easeout function that is making the animation choppy.
I currently remove all easing functions from my code and it's still choppy.

Originally, before I tried the moveTo function, I just tried to keep a constant velocity and I failed to have smooth animation with that.

lime.scheduleManager.schedule(this.spin, this);
lime.scheduleManager.scheduleWithDelay(this.stopSpin, this, 3000, 1);

dd.Reel.prototype.spin = function (dt) {

var position = this.getPosition();
var velocity = Math.floor(900 * (dt / 1000.0));
position.y += velocity;
this.setPosition(position);

if(position.y > 2200) {
    position.y = 0;
}

}

dd.Reel.prototype.stopSpin = function () {

lime.scheduleManager.unschedule(this.spin, this);

}

Everything that I try, I can't get smooth fast animations. I would love to use this engine because of it's simplicity, but if I can't get smooth animations, nothing else matters.

from limejs.

stringa avatar stringa commented on August 24, 2024

I don't believe it was the same issue as #22. I was using this with Chrome on the Desktop.

from limejs.

stringa avatar stringa commented on August 24, 2024

Turns out phpStorm was really affecting the performance I was seeing.

from limejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.