Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » list of z positions to layer
- xlk
-
100+ posts
list of z positions to layer
So, if I have a list of a bunch of clone's z positions, how can I make a script that reads that and will make them go back or forward a certain amount of layers, so as to have them organized from highest z value and highest layer, to lowest.
- mwiedmann
-
100+ posts
list of z positions to layer
If you can get the list sorted from sprite farthest away to sprite that should be on top, then you can just use “go to front” on the sprites in that order and I think that should do it. “go to front” makes that sprite the top sprite which effectively pushes everyone else back, so if you do it in that sorted order it should work.
- nitromian
-
9 posts
list of z positions to layer
Actually, there's a much simpler way to do it. Use the script I used n this project, it works perfectly, and you don't need to have a list:http://scratch.mit.edu.ezproxyberklee.flo.org/projects/10232096 You still need a variable t count how many clones there are, but other than that it's really simple.
- Discussion Forums
- » Help with Scripts
-
» list of z positions to layer