load image from url indoesnt display correct image

0 favourites
  • 14 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • loading image from url on instances does not work sometimes it keeps loading the last loaded image to the instances, not the one is it is set to load

    ____ A concise description of your problem here ____

    Attach a Capx

    ____ Upload a Capx to this post ____

    Description of Capx

    ____ Concise description of what this CapX does ____

    menu that loads icons for games from another site,game list is fetched from a rest api

    creatin instances as menu icons.

    Steps to Reproduce Bug

    • Step 1 run
    • Step 2 watch the 4 icons are using te same image, look which images have been requested with fiddler,it is also printed in debug text box. there should be 4 different icons not 4 of the same. it seems the last loaded image is somehow used for all sprite instances
    • Step 3 etc.

    Observed Result

    there are 4 of the same icons displayed.

    ____ What happens? ____

    there should be 4 different icons not 4 of the same.

    Expected Result

    ____ What do you expect to happen? ____

    there should be 4 different icons.

    Affected Browsers

    Chrome: (YES)

    FireFox: (YES)

    Operating System and Service Pack

    ____ Your operating system and service pack ____

    win7 sp1

    Construct 2 Version ID

    ____ Exact version ID of Construct 2 you're using ____

    r163 32-bit

  • Unfortunately the .capx you've uploaded uses a non-standard plugin from rexrainbow.

  • as far as i can remember i only use the function plugin that might be from rexrainbow.

  • kaiko

    That's what I was referring to

    I'm afraid the rules don't allow the submission of bug reports that include non-standard plugins, so unless you remove the plugin, Ashley won't be able to investigate.

  • ok, made a new version with built in function, i guess i've been using functions for ages never realizing its built in nowadays.

    the issue could be that its trying to load a picture that doesn't exist due to an empty var and then it uses last loaded image instead?

    there is something going wrong in display_games() function

  • do i need to pick an object instance after i just created it with createobject?

    it seems only sometimes it sets the right instance variables after createobject.

  • yah, this got to be a bug,even if i hardcode links i don't get it to work as i think it should,it somehow mixes up images loaded for different sprites...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the bug seems to be: when using sprite->load image from url

    in conjunction with an instance object, it is automatically loaded for all of theinstances of this object, not just the one you picked.

  • another thing i noticed, also it doesn't do a request to load the image rom the url, when i monitor network traffic it doesn't make a call externally, seems it just picks an image it previously loaded image it had in cache and displays it instead.

  • the bug seems to be: when using sprite->load image from url

    in conjunction with an instance object, it is automatically loaded for all of theinstances of this object, not just the one you picked.

    That is by design, because Sprites all share the same image sources to save memory. Closing.

  • i c, can you recommend any workarounds?

  • > the bug seems to be: when using sprite->load image from url

    > in conjunction with an instance object, it is automatically loaded for all of theinstances of this object, not just the one you picked.

    >

    That is by design, because Sprites all share the same image sources to save memory. Closing.

    is there a workaround for this? in order to write dynamic and flexible code, it is essential to set individual images to instances.

    perhaps a setting in C2 with this feature on off.

    as i'm writing a game menu that is populated by a list from a database i need the instances to be able to grow shrink based on the number of items in list, which works but as soon as i assign an unique image to the icon , all instances get the same image.obviously renders the menu useless ass all icons are the same but points to different games.

  • +1 for this.

    Lets say you design a social game with profile pictures, we definitely need this feature.

    We can't share someone's profile picture across all friends.

    Workaround was to pre-create individual sprites.

    But, it only works when the number of friends is a fixed number for everyone.

    Again, everyone has a different number of friends..

    So, the design should be improved.

  • exactly , even if i understand the need to save memory, there should be a way to override the save memory feature to make more dynamic content, your example with profile pics is an excellent example of why said function should work.

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