Giter Club home page Giter Club logo

Comments (9)

ateoto avatar ateoto commented on April 20, 2024

I like this idea. In other frameworks I've used, I like when there's an option to play the animation a certain number of times. I have modified my local copy of Pixi.js to play an animation once through if requested, but I'm terrible at JavaScript and my solution is hackish and vulgar at best.

from pixijs.

cfurrow avatar cfurrow commented on April 20, 2024

Hah, great! If you're willing to post your code in a fork, we can smooth it out together and then you can do a pull request. I haven't looked into ways to keep track of which frames have been rendered, although I did see a property for movieClip.currentFrame, or something like that (on my phone right now, or I'd verify).

Carl Furrow

On Thu, Mar 21, 2013 at 10:06 PM, Matthew McCants
[email protected] wrote:

At the very least, I like when there's an option to play the animation a certain number of times. I have modified my local copy of Pixi.js to play an animation once through if requested, but I'm terrible at JavaScript and my solution is hackish and vulgar at best.

Reply to this email directly or view it on GitHub:
#19 (comment)

from pixijs.

piayo avatar piayo commented on April 20, 2024

i think need like the "onEnterFrame".
updateTransform(requestAnimationFrame) unicolle EnterFrame(tick)
http://www.createjs.com/Docs/EaselJS/files/.._src_easeljs_utils_Ticker.js.html#l379

from pixijs.

ateoto avatar ateoto commented on April 20, 2024

This is what I have so far, it works for me, although it blindly goes to the first frame when it's done playing. This might not be ideal for everyone.

https://github.com/Ateoto/pixi.js/blob/feature-playonce/src/pixi/MovieClip.js

Also, here is a preliminary implementation of a function that will play the animation once, and then execute a callback. Again, I'm not really a JavaScript guy (just now getting into it.) So take it with a grain of skepticism.

https://github.com/Ateoto/pixi.js/blob/feature-playonceandthen/src/pixi/MovieClip.js

I ran it like so.

my_rad_movie_clip.playOnceAndThen(function(){
    console.log('Im done, now what?');
});

from pixijs.

ateoto avatar ateoto commented on April 20, 2024

Anyone have any thoughts on this? I have the feature-playonce branch merged into my dev branch and it's been working well for me. I'll sit on this for the next few days, and then submit a pull request if no one has any major objections to my code.

from pixijs.

GoodBoyDigital avatar GoodBoyDigital commented on April 20, 2024

Sounds good to me!

from pixijs.

GoodBoyDigital avatar GoodBoyDigital commented on April 20, 2024

closing this bad boy as just realized this functionality now exists #74 :)

from pixijs.

cfurrow avatar cfurrow commented on April 20, 2024

👍

from pixijs.

lock avatar lock commented on April 20, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from pixijs.

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.