How do I make a gallery of grouped objects?

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello!

    I'm stumped on how to tackle this system I've been trying to code.

    Here's how I want it to work:

    The player can collect photos. The photos can be viewed in a gallery in groups of four and can be looped though.

    What I can't figure out is how do I display these images in the order the player has collected them, and how would I display the remainder amount of photos at the end of the gallery if the remaining photos don't fit into a group of four before looping back to the beginning again?

    Any thoughts on how to do this is appreciated!

    Thanks.

  • I see you added array to the tags there and this would be my guess, when you collect a photo you add it to the array. This leaves them in the order you collect, as you cycle through the gallery it has preset objects for displaying 0, 1, 2, 3, then you add 4 to each value to display the next row i.e. array.at(0) would become array.at(4) - a variable on the object itself used for the x. If array.at(x) is empty you can make them invisible when it is displaying the last few.

  • Hi Lionz! Thank you for replying.

    I attempted to implement the system you've described, and for the most part I'm pretty sure I understand how it needs to work. The problem is that the photos don't seem to be updating their animation to the X value on the array that they are supposed to be displaying. (the animation names match the array values)

    Here's how I update the displayed photos.

    Here's the array, with some photos in it.

    When the gallery function is called, it creates four photo objects, each one has the X index they are supposed to display (0,1,2,3) in their X_Index var.

    I'm new to using arrays, so I'm not sure what I'm doing wrong here.

    Thanks for any help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay sorry, I figured it out. It was a dumb mistake:

    I didn't need to add the "Photo" in the "Photo" & Photo_Array.At(self.X_Index), Since the array X value was already set to the full animation name I was setting.

  • Great you figured out that bug so I don't have to, looks good!

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