Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Using .image and then setSpriteAnimation() gives error message.

    Bug Reporting (FUZE 4 Nintendo Switch)
    4
    8
    194
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vinicity
      vinicity F last edited by vinicity

      Doing the following:

      a = createSprite()
      a.image = myImage
      setSpriteAnimation(a, b, c)
      

      yields the following error message:

      Sprite image must be set before calling setSpriteAnimation.
      

      The workaround is to use

      setSpriteImage(a, myImage)
      

      instead, but I prefer to set the Sprite params directly.

      pianofire 1 Reply Last reply Reply Quote 2
      • P
        petermeisenstein F last edited by

        At first I dont know anything about sprites but i think you can only use a.image when you declared it at first in a struct but maybe i could be totally wrong

        1 Reply Last reply Reply Quote 0
        • pianofire
          pianofire Fuze Team @vinicity last edited by

          @vinicity I think that this is a known problem with this sprite property

          P 1 Reply Last reply Reply Quote 1
          • P
            petermeisenstein F @pianofire last edited by

            @pianofire Is it a bug ?

            1 Reply Last reply Reply Quote 1
            • Martin
              Martin Fuze Team last edited by Martin

              It is not a bug.

              Accessing the image of a sprite directly like that is not implemented. It is one of the few that is not. I confirmed this for myself last week when I was trying to do this myself and it was not working (I have access to the source code). By writing a.image = myImage you have created a custom sprite property that has nothing to do with the sprite's image. You must use setSpriteImage(sprite, image) in this instance.

              [edit] I suppose it is fair to say that it is a bug in the help pages :)

              pianofire 1 Reply Last reply Reply Quote 1
              • pianofire
                pianofire Fuze Team @Martin last edited by

                @Martin I had better update it then!

                1 Reply Last reply Reply Quote 2
                • Martin
                  Martin Fuze Team last edited by

                  Not had my daily pint of tea yet :)

                  1 Reply Last reply Reply Quote 1
                  • vinicity
                    vinicity F last edited by

                    OK, so the bug is with the Help page, and setting it directly is not supported. That's fine. I was fooled by the Help page... :)

                    It would be great if all the sprite params would be accessible directly, though. It feels kind of arbitrary at this time which are and which are not.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post