PixelPicoSean Posted May 15, 2015 Share Posted May 15, 2015 Hi everyone, Since Panda v2 is under development and is not ready for use in production yet, I make a fork and add some newly introduced API to v1.13. Check it out here: https://github.com/pixelpicosean/panda.js List of changes:Replace Animation with the new one in v2 branch.Add "fadeIn" and "fadeOut" methods to Audio, which is also available in v2.Move Vector from physics to geometry module and use it as a better replacement of PIXI.Point.No need to call this.super(); in Scene.update and you can custom its update order like v2 does.Some features like "pixel based anchor" is much harder to add so I did not change. It is made for people who want to create NEW games and worried the code may not work when v2 is released or want to use new API for next serious game. Hope you like it SkyzohKey 1 Quote Link to comment Share on other sites More sharing options...
mrkarate Posted May 22, 2015 Share Posted May 22, 2015 just got it, but get an error, can't find game.animation.gotoAndPlay function, it's there some changes? Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted May 22, 2015 Author Share Posted May 22, 2015 "gotoAndPlay" is not available in v2, so it is also not in this repo.You'd use "play" and "gotoFrame" instead. Quote Link to comment Share on other sites More sharing options...
mrkarate Posted May 22, 2015 Share Posted May 22, 2015 thanks Quote Link to comment Share on other sites More sharing options...
mrkarate Posted May 22, 2015 Share Posted May 22, 2015 how you control if the animation is loop, and the speed? (animationSpeed and loop =false don't work) Quote Link to comment Share on other sites More sharing options...
mrkarate Posted May 22, 2015 Share Posted May 22, 2015 and e.global.x don't work to get mouseX from stage Quote Link to comment Share on other sites More sharing options...
mrkarate Posted May 22, 2015 Share Posted May 22, 2015 forget about animation loop and speed, I edited and add the properties on the renderer class, and send the parameters this way, myAnimation = new Animation(MyarrayTexture,Myspeed,IsLoop), so this way I have some as before, I don't know why the new anim system don't have some speed and loop params to individual anim, or at least I don't know a way, but it's not a problem now, Still dont know where I can find mouseX and Y... Quote Link to comment Share on other sites More sharing options...
mrkarate Posted May 22, 2015 Share Posted May 22, 2015 nevermind, now all mouse callbacks got x,y params, mousemove(x,y) so don't worry, thanks! this version has some performance improvements over 1.13.1 on mobile?? thanks! Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted May 22, 2015 Author Share Posted May 22, 2015 You can define animations by using "addAnim" method, here's an example:// Create an animation instancevar myAnim = new Animation(['p001.png', 'p002.png']);// Define a new sequenced animationmyAnim.addAnim('animA', [0, 1], { loop: false, speed: 6, onComplete: function() { console.log('anim finished'); }});// PlaymyAnim.play('animA');My fork does not have any improvements related to official v1.13.1, it just brings some v2 APIs. Quote Link to comment Share on other sites More sharing options...
mrkarate Posted May 22, 2015 Share Posted May 22, 2015 this system is REALYY GOOD!, thanks! it's this a real advantage over the current anim system? for example, I have an spritesheet with 80 frames, where are anims up down left an right, current I do this way:arrayFramesUP = [frame 1, frame2.... frame20];arrayFramesDOWN = [frame21,frame22,frame40];,.... etc, and then create the animations: player[0] = new Animation(arrayFramesUP);player[1] = new Animation(arrayFramesDown);player[2] = new Animation(arrayFramesLeft);player[3] = new Animation(arrayFramesRight); then I create a playerContainer and add the four anims, and make visible only the anim I need and play it,with the new method, I can create only one var anim player, and then add the four sub anins, so I haveplayer.upplayer.downplayer.leftplayer.right it's better for understand, I like more, BUT the real important thing, is there a performance difference, to have one var anim and subs anims, or it''s the same thing I have four vars anims with no subs anims? thanks! Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted May 23, 2015 Author Share Posted May 23, 2015 I also like the new animation API, thanks @enpu. There should not be any difference of performance between PIXI.MovieClip and new Animation, but it'll be much easier to switch between different ones now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.