que Posted May 20, 2019 Share Posted May 20, 2019 Hello everyone, I'm new to Pixi, and so far I'm very impressed with the performance and ease of use... There's one thing I can't find any examples/resources on how to do, and that is how to draw a sprite animation. I have this sprite below, which I'd like to split up and be able to animate. I can't define what sprites I will need in setup, so I'd like to be able to load it 'on the fly'. I can do this with regular sprites with this piece of code: var textures = new Map(); function getSprite(url) { let texture = PIXI.Texture.from(url); textures.set(url, texture); return new PIXI.Sprite(textures.get(url)); } Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 20, 2019 Share Posted May 20, 2019 That's how you create a texture out of big sheet: "new PIXI.Texture(baseTexture, new PIXI.Rectangle(0,0,32,32))". That question is very frequent. que 1 Quote Link to comment Share on other sites More sharing options...
que Posted May 20, 2019 Author Share Posted May 20, 2019 54 minutes ago, ivan.popelyshev said: That's how you create a texture out of big sheet: "new PIXI.Texture(baseTexture, new PIXI.Rectangle(0,0,32,32))". That question is very frequent. Cheers! ivan.popelyshev 1 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.