Alain91 Posted November 10, 2013 Share Posted November 10, 2013 Hello Pixi.js I have a png image with all my sprite animations. I would like to use it like an atlas, so a spritesheet in Pixi terms. It seems that everyone use texturepacker from code'n'web. The problem is that you have to split every anim piece in multiple files, then import it in texturepacker :/ Is there a way to - load the entire anim file- get textures via code ? like load picture("anims.png")anim1 = gettexture(0,0,16,16)anim2 = gettexture(16,0,16,16)anim3 = gettexture(32,0,16,16) thanks for your help,Alain Quote Link to comment Share on other sites More sharing options...
xerver Posted November 10, 2013 Share Posted November 10, 2013 Yup, look at the atlas loader. It does exactly this. Every texture has a "frame" which is a rectangle that defined the part of the image file to use for that Texture. Basically just create a texture using that image and specify the frame (rectangle) to use. Notice you can pass a frame object as the second parameter to a Texture: http://www.goodboydigital.com/pixijs/docs/classes/Texture.html 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.