Comments (9)
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.
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.
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.
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.
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.
Sounds good to me!
from pixijs.
closing this bad boy as just realized this functionality now exists #74 :)
from pixijs.
👍
from pixijs.
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)
- Bug: Moving a DisplayObject to a different Container prevents the mouseout event from working reliably
- Bug: Incorrect calculation of vTextureCoord when scaling parent container HOT 1
- Bug: pointerover/pointerout fire twice when eventMode HOT 10
- Bug: BitmapText multiline and missing characters
- Bug: v8.0.0-rc.5 Culled containers are culled forever HOT 4
- Bug: Pixi 8 build with vite get warning and pixi crashes when minify is turned on HOT 2
- Bug: 8.0.0-rc.5 no longer renders sprites on Firefox HOT 2
- Bug: in docs, example for PIXI.Geometry draws a dovetail instead of a square HOT 2
- Bug: v8.0.0-rc.6 Texture.update() not working as expected
- Bug: Transparent Background doesn't work HOT 2
- Bug: When curve the text, the bounds of the text get cut off in pixijs 4.8.9 HOT 1
- Bug: Adding fill to certain Graphics with reversed normals causes lineStyle stroke to reverse inner/outer position
- Bug: 'Worker is not defined' with Pixi 7.4.0 and Node v18.17.1 HOT 15
- Bug: Incorrect Text color
- Bug: v8.0.0-rc.7 Calling Texture.update() causes texture rendering to fail HOT 2
- Bug: v8.0.0-rc.7 Exception when rendering odd-sided polygon after even-sided polygon
- Feature Request: Add Multi-Touch events HOT 4
- Bug: v8.0.0-rc.7 Canvas texture conflicts with Graphics when WebGL is used HOT 3
- Bug: v8.0.0-rc.7 iterating into a container and using removeChild causes object to to not be rendered
- Bug: v8.0.0.rc-8 Texture.update() does not update when source is resized HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixijs.