0 Favourites

Load Image From Url into instances

  • Link to .capx file:

    LoadImage.capx

    Steps to reproduce:

    1. Two instances of same sprite in layout

    2. Load image to sprite

    Observed result:

    <img src="http://i.imgur.com/1FUrjBv.png" border="0">

    Expected result:

    <img src="http://i.imgur.com/fqDOIxd.png" border="0">

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Operating system & service pack:

    winxp sp3

    Construct 2 version:

    115

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • They have to be using different frames.

  • As i am also speaking with Pode on this matter for his Drag & Drop zone plugin.

    Here is the Capx

    I need to be able to use his drag & drop zone to load different images into different instances

    In the app im currently working on this is a main feature to truly connect the people with it.

    User content is key for it to work as it was meant to be.

    So i really hope this gets done <img src="smileys/smiley20.gif" border="0" align="middle">

  • Ps: I also tried using different Frames & Animations per instance, but it still turns black.

  • Eh? Open the .capx, double click one of the objects, add a frame, set one of the default frames to 1, and the image will be loaded into both instances.

  • Tokinsom

    Thanx! U Solved it:-)

    I am very greatfull!!

    Kind Regards.

    Savvy001

  • Tokinsom

    Thanks for the idea

    I works indeed with that capx!

    But for a strange reason it stops working when I trigger it with a button (like in my project) instead of the layout start o_O

    Also, in my case it's for the background sprite and I need it visible from the start. If I need to create two frames with the big background, it will double the loading time at export, and it's maybe not good for performance either...

    Anyway, this would deserve to work without workarounds if possible

  • this is by design and not a bug, can be closed.

  • Care to explain why it would be by design?

  • Ashley

    I have a new issue with this.

    The method above is fine if i would have a "known" amount of sprite instances i need to use.

    Then i would just give the main sprite enough frames.

    In my case i cant predict the amount of frames the user is going to fill with their own image's.

    So as they progress in the game, they add more sprite instances.

    But when the frame amount runs out it would mean that the user could no longer insert their own images.

    Simply because all the "set" frames are already filled.

    It would look like.

    Amount of sprites: 200

    Amount of instance frames: 200

    = 200 frames can be filled with user images

    (This setting is good for static games)

    My case is:

    Amount of sprites: 200 & growing by user

    Amount of instance frames: 200

    = 200 frames can be filled with user images, but sprite amount will exceed this limit.

    (Here i have a problem because i cant "grow" the frame amount)

    Do u have a solution?

    Kind Regards

    Savvy001

  • Why do you need to load 200 images at runtime? That doesn't sound like a smart use of image resources. Importing images to Construct 2 ensures they are managed efficiently while exporting and at runtime.

  • Ashley

    Its not about smart use.

    Its about user content. (loading the face's of friends and all kinds of stuff)

    The users can upload their own images into the sprite instances using the Drag&DropZone plugin provided by Pode.

    Then with the dropbox plugin provided by septeven they can upload/download their complete webstorage: wich is growing bigger with more images each time they add new ones.

    For each image they upload, a new sprite is spawned and the image is set.

    But because of the fact that i cant spawn clone's of sprites, i am limited to instance frames for setting the uploaded image per sprite.

    So if i would give the main sprite 200 image frame "slots", but the amount of sprites eventualy reaches above 200.

    Then there wont be anymore frames left for the user to upload his images to.

    And i just dont want to limit the users because of a "estimated" pre-set amount of animation frames.

    I hope i explained it well?

    Kind Regards.

    Savvy001

  • I'm going to close this: I don't think we can officially support what you're trying to do. Perhaps you could look in to third party plugins to cover this.

  • Ashley

    Okay and what about the original post?

    Whether we need to load an image into 200 or 2 instances the problem looks the same to me

    Getting a black sprite from a regular function isn't something one would expect from a commercial game tool, and still looks like a bug from my point of view...

    It's perfectly fine with me if there's a technical limitation to this, or if it happens by design as ranma stated, but it would at least deserve an explanation here or a mention in the manual

  • lemo - you're right, I was confused by the other details in the thread. I took another look at the original .capx and it turned out to be a WebGL specific issue, and should be fixed in the next build. Please note in future your bugs may be resolved more quickly if you test across all three browsers in the bug report field; in this case, if you had tested in IE rather than leaving that field blank, it would not have been affected and that would have provided an important clue to resolve this issue quicker.

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