0 Favourites

How do I control the sprite animation frames from XML file?

  • I want to change the frames of a sprite animation or even make changes to it at the end of each paragraph of a XML file. Is it possible?

  • It is possible, but quite a bit of a roundabout method. Any particular reason you need to use XML?

    Here is a rough idea of the steps:

    Import your XML file as a project file.

    Load the XML file into memory with AJAX.request.

    Access the data with AJAX.lastdata.

    Use tokenat() to parse the information you need from your XML file.

    Use the information you got to set the Sprite Animation, or to destroy and replace with another Sprite.

  • It is possible, but quite a bit of a roundabout method. Any particular reason you need to use XML?

    Here is a rough idea of the steps:

    Import your XML file as a project file.

    Load the XML file into memory with AJAX.request.

    Access the data with AJAX.lastdata.

    Use tokenat() to parse the information you need from your XML file.

    Use the information you got to set the Sprite Animation, or to destroy and replace with another Sprite.

    I want to use to set a specific frame in according to the text that is shown, but it seems it takes a lot of work, so, I''try to find another solution. Thanks at all.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Well depending on how you show your text, you could add a simple sprite: set frame action to whatever triggered the text to show - that would be much simpler!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)