Editing single iterated object

mobliss's picture

Hi!

I´m new to qc so a little help is needed with iterator functioning. I have a grid of sprites showing videos (I´m inputting a structure to the iterator)and Iḿ trying to animate single sprites at a time. Can someone tell me how is it possible to edit for example the coordinates of a single sprite from a structure before it goes into iterator or can I edit the data individually inside the iterator somehow? -m

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

detour's picture
Re: Editing single iterated object

You can use the Iterator Variables patch to access each iteration via its Current Index output. Put it inside the iterator. For example if you had 8 iterated sprites and want to position them in some sort of grid, you can attach a math expression patch to the current index output to multiply by a formula and feed that into the X or Y position. If you want to do something more specific to a certain sprite, you might have to parse the index using Javascript.

benoitlahoz's picture
Re: Editing single iterated object

For grids, I suggest using two iterators, one inside the other : one for rows, one for columns.

benoitlahoz's picture
Re: Editing single iterated object

double post

-polygon's picture
Re: Editing single iterated object

You can also use a multiplexer patch, where you connect current index from iterator variables to multiplexer source index and the multiplexer output to the input which you want to change, if you have the same number of inputs on the multiplexer you will be able to change the chosen input for each iteration through the same patch.

PreviewAttachmentSize
iterplexer.qtz3.12 KB