How do I load image for different sprites

0 favourites
  • 8 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I have sprite with var called URL in it.

    Im creating some number of sprites using loop and set different URL values to every sprite.

    Then, I want to load image for every sprite using this URL var.

    But it doesnt work! Is there any way of making it possible?

    Im kinda tired of this disability of C2. Title says "You can now make advanced games without writing a line of code." but it can't even load image for sprite as users want it to. It is obvious that if there is such feature people will want to use it as a way of loading DIFFERENT images for DIFFERENT instances of same sprite.

  • Here's a working example.

    [attachment=0:3sg8tybm][/attachment:3sg8tybm]

    EDIT**

    [quote:3sg8tybm]Im kinda tired of this disability of C2. Title says "You can now make advanced games without writing a line of code." but it can't even load image for sprite as users want it to. It is obvious that if there is such feature people will want to use it as a way of loading DIFFERENT images for DIFFERENT sprites.

    Just noticed you said here Different Images for Different sprites. But in the image you posted you look like you are trying to loop through multiple instances of 1 sprite. My example is for loading the image for multiple instances of 1 sprite.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's a working example.

    [attachment=0:1hv3v8f1][/attachment:1hv3v8f1]

    Works here, that's fun Anyone out there used this much in their games?

  • Tiledbackground can load different images for each instance, here's an example.

    https://dl.dropboxusercontent.com/u/139 ... image.capx

  • Here's a working example.

    [attachment=0:16n1ji8c][/attachment:16n1ji8c]

    EDIT**

    [quote:16n1ji8c]Im kinda tired of this disability of C2. Title says "You can now make advanced games without writing a line of code." but it can't even load image for sprite as users want it to. It is obvious that if there is such feature people will want to use it as a way of loading DIFFERENT images for DIFFERENT sprites.

    Just noticed you said here Different Images for Different sprites. But in the image you posted you look like you are trying to loop through multiple instances of 1 sprite. My example is for loading the image for multiple instances of 1 sprite.

    So, the problem is in number of Animation Frames? If I have like 802 possible images, i should make 802 animation frames? If it possible to add new frames during the game?

  • yes codah I have in one of our game for someone on contract

  • Awesome

  • So, the problem is in number of Animation Frames? If I have like 802 possible images, i should make 802 animation frames? If it possible to add new frames during the game?

    You can't add animation frames at runtime if I recall correctly.

    You'd only need 802 frames if there are going to be 802 instances of the sprite on screen at the same time. You would have to think about how many sprites can appear and maybe a different way of storing the URL either in an array or dictionary. That way you can use the same sprites all the time but reload a new image from url into that same frame as and when needed.

    A lot depends as well on the type of game you are making.

    It's not going to be super easy to achieve what you want but with a bit of planning should be achievable.

    EDIT***

    If you don't mind the use of 3rd party plugins Rojohound's paster plugin might be a better option. But again depends on what type of game you are making.

    https://www.scirra.com/forum/plugin-paster_t88750?&hilit=paster

    [attachment=0:2wgjkih6][/attachment:2wgjkih6]

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