I need to import 200 sprites

0 favourites
  • 11 posts
From the Asset Store
Set of 200 hand drawn skill icons. All icons are of a high quality.
  • Hi!

    I'm trying to make a game where an area of ground is broken piece by piece. I managed to create a python script that uses a voronoi pattern to shatter my image into several small irregular pieces.

    Now I need to import those 200 pieces into Construct. I know that if I set the position of each peace to 0,0, they will form the full image perfectly. After that I can crop the pieces to their actual pixels and things work nicely.

    The only pain point I have is importing 200 sprites one by one into Construct. Is there any way to do this efficiently? If I drag them all at the same time, an animation is created. But can I somehow indicate that I want individual sprites instead of animation frames?

    Tagged:

  • Are you sure you want 200 objects? Maybe there is a better way to achieve what you are trying to do in the game.

  • Best way to move 200 Sprite at once

    Drag drop all pieces in to viewport

    Add instance variable at number

    Now get all pieces in to screen individually

    System

    Repeat 200 times >> create object on 0,0 position

    After end set

    For each >> set number loopindex+1

    So on screen you have 200 sprites

    And for each sprite has different frame

    So

    For each sprite >> sprite set frame self.number

  • Thanks Gravi that's a decent way to do it. The only thing is that this will only show the images in place during runtime, but it would be helpful to see them positioned correctly already the editor.

    I'm looking at a couple of alternatives here. One would be using the project folder feature and write some kind of a script that would mass generate the required JSON files for all the assets.

    I'm also looking into xdotool which might allow me to automate 200 mouse drag and drop operations on top of Construct.

    Let's see how this goes. Probably I will spend 2 hours trying to automate this and then give up and do the whole damn thing manually anyway. :D

  • Ah automated hack is xd

    Can you make jigsaw puzzle

  • Ah automated hack is xd

    Can you make jigsaw puzzle

    It's a bit like a jigsaw puzzle indeed, only the pieces have voronoi shapes.

  • O, may be you need to start drag drop challenge in 20 min 😂

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, if you import files, you can import multiple images at once, but I don't know if it's okay to use the files for what you need to do

  • Hi, if you import files, you can import multiple images at once, but I don't know if it's okay to use the files for what you need to do

    I believe dragging and dropping multiple images will add them as frames for the same object. But I'm trying to get separate objects.

  • Okay managed to automate this using the Project Folder feature and a bunch of Python scripts. It was a bit tricky, since the Project Folder required edits in several places. I wrote a quick tutorial of the process (with the Python scripts included) in case someone else needs to do this kind of a bulk sprite import at some point:

    oneminutevideotutorials.com/2023/12/15/automating-the-import-of-hundreds-of-sprites-to-construct

  • Thank you very much for sharing the tutorial, yes if you drag the images they become frames of a single sprite, I meant that if you go to the File folder, right click import images, it makes you import more than one as separate files, but they are not created as well sprites automatically, so I don't know if you could have used them for what you needed anyway

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