p1100i Posted December 2, 2015 Share Posted December 2, 2015 I kinda like the concept, to have one spritesheet file for my whole animation. However I've found in most of the PIXI related animation tutorials the use of loading all the frames as separate files. Is it a bad practice from performance standpoints to use a PIXI Rectangle over the same texture to have the frames? I'm just curious about the performance when the animation plays. The initial load is ofc better w/ this solution, but if this causes worse animation times than I need to change it, so my code:createFrame = function createFrame(texture, offset, size) { return new PIXI.Texture(texture, new PIXI.Rectangle(offset.x, offset.y, size.x, size.y));}animation = new PIXI.extras.MovieClip([ createFrame(texture, ...), createFrame(texture, ...), ...]); Quote Link to comment Share on other sites More sharing options...
rich Posted December 3, 2015 Share Posted December 3, 2015 Always, always pack your frames into a sprite sheet. If you don't you'll break the WebGL batch system every single time it has to render one of your animated sprites. The performance loss from this will far exceed anything you could ever do with a Rectangle. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 4, 2015 Share Posted December 4, 2015 Translation: everything is ok in your code. Keep it up. 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.