Dynamic 'for each' position

Hi,

So I know I can use a ‘stack-layout’ node for horizontal/vertical distribution, but I was wondering what a good way to have a more dynamic distribution of items in a collection would be. e.g. from top left of screen to bottom right or chess-like patterns or something else .

Thanks!

The Flow Layout node is the best way to handle that. It’s quite flexible and with things like item spacing, or adding empty items with just a group for spacing, it can build most kinds of grid patterns.

Thanks! I’ll have a look at it.
What about a circular pattern?

I have a simple JS snippet:

var theta = ((Math.PI*2) / inputs.collection_count);
var angle = (theta * inputs.n_th_item_in_collection);
outputs.pX = (radius * Math.cos(angle));
outputs.pY = (radius * Math.sin(angle));

At the moment I can’t seem to find a way to return an item number inside a collection (which collection item are you), I think that would solve my problem instantly.

You can use the Child Index output from the visual root node in the component, probably a group or a layout node.