-
Limiting index-driven values within range, and looping the overflow.
Hey all, trying to make a grid system using a bunch of 120px square shape layers. The x position is governed by the layer index. I was wondering how I’d be able to force the x positions to fall between -900 and 900, so that a value of 1020 would return -900, and 1140 would return -780 and so on.
Ideally, each cycle would output a value that can be used to affect the Y position. But my priority is figuring out the X position.
I vaguely recall seeing an expression that fit the bill, long ago, but “loop” and “cycle” aren’t the best search terms.
x =-900+120*(index-1);
y = value[1];
[x,y]