Load image from URL to one instance of a sprite

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
Custom Loading Icons to Enhance Your Loading Screens
  • Hi,

    I want to change the image of one instance of a sprite, but when I pick one sprite, the image on every copy of a sprite is changed:

    + FileChooser: On changed

    ----+ Sprite: Pick instance with UID 2

    -----> Sprite: Load image from FileChooser.FileURLAt(0)

    -----> Sprite: Set size to (30, 30)

    (The size of sprite UID 2 changes as expected).

  • Yes, the image is always replaced for all instances. You can load it into a different frame.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you, it worked!

    For others, here is my working code:

    (Don't forget to put the speed of the animation to 0, so the animation doesn't play to the last frame, like I did at first)

    + FileChooser: On changed

    -> Sprite: Add animation frame to "Animation" at -1

    -> Sprite: Set animation frame to Sprite.AnimationFrameCount-1

    -> Sprite: Load image from FileChooser.FileURLAt(0) (Keep current size, cross-origin anonymous)

    ----+ Sprite: Pick instance with UID 2

    -----> Sprite: Set animation frame to 0

    -----> Sprite: Set size to (250, 250)

    ----+ Sprite: Pick instance with UID 3

    -----> Sprite: Set animation frame to 1

    -----> Sprite: Set size to (250, 250)

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