Jump to content

Update vertices for AnimatedSprite


ILTP
 Share

Recommended Posts

Hi, I am building an app where we would like to distort images. I can make it work for a SimplePlane doing: _img.verticesBuffer.update(_vertices);  but I can't do that with AnimatedSprite. Any clue how to do something like that, so I define the number of vertices and then being able to update them?

Link to comment
Share on other sites

AnimatedSprite is not a mesh and it has no separate vertices. Easiest way would be to create your own mesh similar to SimplePlane and add AnimatedSprite functionality to it. So basically create your own mesh that updates the texture similarly as how AnimatedSprite does.

Link to comment
Share on other sites

Here's the class that can be used for any object that has texture, not only sprite : https://github.com/pixijs/pixi-heaven/blob/master/src/animation/AnimationState.ts

Here's how to use it: https://github.com/pixijs/pixi-heaven#animation

Hope you know how to do Meshes :)

Edited by ivan.popelyshev
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...