Sprites: Load image from URL on the same sprite instance = All sprites load the same image

1 favourites
  • 7 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • Can anyone clarify what's going on here?

    I've got a sprite called profile photo.

    I loop over the players list

    I select the ProfilePhoto sprite and load an image

    It loads, for sure!

    On the next loop, the previous sprite is overwritten :(

    Even if I set a property like "PhotoIsLoaded" and set that true, and build logic around it -- it appears that all sprites are written.

    Anyone have this experience?

    Right now I guess the only solution is creating more instances?

    Tagged:

  • Each image can only be loaded in a separate frame.

    For example, if it is a list of players:

    *For (0 to (PlayerList.count - 1))
    FrameSprite: Set animation frame to (loopindex)
    FrameSprite: Load Image by URL [ImageOf(loopindex)]
    

    Then, if you want to show each frame.

    * Trigger Once
    FrameSprite: Set animation frame to (FrameSprite.Index)
    

    Here is a sample use-case, Leaderboards:

    I have a Leaderboards addon. For each player score, I retrieve the ImageURL of that player's score. At the same index, I set the animation frame corresponding the current player index. Then, I load the current ImageURL into that current animation frame.

    I repeat the same process for all players in the loop.

    I hope that helps.

  • Hey Chadori, I have all your plugins, they're amazing.

    This is the logic I needed, thank you.

    It kept replacing I suppose frame 0 for each loop. So I appreciate you showing me this method, will try it out.

    Again, your plugin suite is CRAZY good. World class customer service. Thank you.

  • You're welcome, and thanks! 🙂

  • Hello,

    What im missing here?

    I have 2 scores for now in this leader-board , 1 with my fb account and the other 1 with test user.

    When i run it, it creates 2 sprites but with the same photo.

    The picHolder has 1 frame only.

  • I had success creating 10 different sprites and manually selecting them. Dirty trick.

    However I guess you load them into frame 2,3,4,5,6

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I have to add blank frames to my sprite?

    What if the leaderboard contain 1000 scores?

    I have read a lot of threads but no one gives the final answer.

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