LCD sprite move?

Brian H.'s icon

Is there such a command? Or workaround, other than clearing and re-drawing? Better yet, a way to make a sprite draggable in the UI? I'm looking to place some images in an LCD, be able to have the user move them, and to have Max track their position.

I searched and read the docs, nothing looks too promising...

Thanks,
Brian

lasmiveni's icon

I'm not sure about your question...
but perhaps the use of "thispatcher" can help you.

Scott JS's icon

Here's one way to do it with a thispatcher object and pictctrl objects for sprites. Hit the button in the top left, and then you can drag around the three gray pictctrl objects when the patch is locked or in presentation mode.

This uses a mousestate object to poll the mouse position, and then a three-way gate to route the XY coordinates to one of three scripting messages that moves one of the three pictctrl objects. The pictctrl objects are in button mode, so they send out a 1 when you click and hold (=click and drag) and a 0 when you release the mouse button. They're linked to [select 1] objects so that when you click, they'll bang a message box that opens the appropriate gate. When you release the mouse, the 0 from the pictctrl goes out the right outlet of the select object to close the gate entirely so that the coordinates aren't triggering any of the move messages.

You can track the positions of the three pictctrls (which you can set to any image you want...see the help/ref files) by also sending the latest coordinates sent out of each of the three gate outlets to number boxes (or however you want to store that info).

Max Patch
Copy patch and select New From Clipboard in Max.

Is that what you had in mind?

Floating Point's icon

wow that's pretty inventive:)

my version is a bit more pedestrian, using lcd:

Max Patch
Copy patch and select New From Clipboard in Max.

edit-- just read the OP properly-- you wanted pictures. Have a look at the [images] subpatch in the lcd helpfile-- you can adapt my patch to your purposes with the images commands

Brian H.'s icon

Wow, both are cool, thanks! I love that they're so different and each have their own distinct-- and very Max-ian-- logic. :)
Either would fit the bill...

Camilo Leal's icon

@floating point, this is just what I was looking for.
I maped three sounds on a 2d plane to move'em around an 8 ch system.
I guess it is already done, but it was a lot of fun.

8ch3sounds7compatible.maxpat
text/plain 2.01 MB