I’ve created a small test patch, trying to create a 2 dimensional spread of sprites, and then select from the resulting array.
One spread controls my x axis of sprites, and another the y axis, but when selecting, I can only select from one axis.
In my test patch I can only select a vertical column of sprites, and never a row. How can I gain greater control over slice selection when dealing with more than one dimension?
I’ve attached the test patch in case it helps illustrate the issue.
there are several ways to that. i sketched 4 of them ;)
in the first patch getslice (node) is used to select the transforms. note that if you use the transform feature of the sprite module, then you shouldn’t also use x and y pins of the module. you would just double the transform in that way. btw imho forgotten spreads in pins are the most convenient way to mess up patches. so take care of stuff like that. so in that patch the sprite module is only spreaded over the slected transforms. to select rows (over y index) you can just use the bin feature of getslice. bin = row in our example. so just set binsize to x resolution. selecting columns is not as easy. you need to calculate the indices for that. inspect the spread on the second getslice and use the index of the green sprite to understand the index ordering…
the second example tries to use the binssize also for column selection. to be able to do that, rows and columns of the incoming spread of transforms need to be swapped. the I (Spread) reconstructs the original indices. SwapDim (Spreads) changes the ordering. with the upper GetSlice (Node) the transforms are resorted. after that you can use the BinSize feature…
tries to do the same but even more index centric. the goal was to put all transforms in one spread, to be able to use only one sprite module. x and y index now only compute the indices within the transform spread. _in fact i’m not sure: there has to be a module for that, not(?) like SelectRow, SelectColumn (?)._Anyway. Only indices are computed and put together into a spread holding all indices which need to be drawn. Only one GetSlice (Node) operates on the transform spread. colors are seleected to get the same visual result as before.
doing it the easy way.
if you want to design ( texturize, colorize …) the original 2d sprite matrix and only want to select afterwards which of them should be drawn the slice centric way is the way to go. otherwise other approaches might be easier and more flexible.
hope you have some fun with it!
oh yeah. #5.
is based on #3 but the indices are used to put a huge color spread together. all sprites are drawn.
I still can’t find a way to select my sprites un-invasively. For example, if I want to draw all of them, then select just some and trigger a reaction on them, I can only seem to do it on the one axis. For example, how would I achieve the effect in the attached patch, but moving the other way…?