• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Get Number Of Background Sub-Layers Through GML

  • Thread starter Jordan Robinson
  • Start date
J

Jordan Robinson

Guest
A little bit of background to what I am trying to accomplish - I am trying to make a parallax scrolling effect using multiple background images with various x offsets. There is 4 different "depths" being: Sky, Distance, Background, and Foreground. Each Background image is a sub-image of the initial background for each of these depths. I did this so I could reference all of the images for a given depth at once.


Because each depth has multiple background images (non-repeating) with different x-offsets, I need to be able to store the start x position so I can correctly shift the background to give the parallax effect. My hope was that there would be some way to loop through all of the sub-layers but I have been unable to find any relevant info in the documentation. Any help would be appreciated. Perhaps there is an easier way to set this up...

Thanks!
 
Top