Forum Archive

Touches

Rothrock42

I've been playing with the sample scene file and the touches. I wanted to give each touch a random custom color. I notice that each touch gets a TouchID and was hoping to add the color to that, but I can't seem to do it.

Do I need to make my own dictionary or something like that to track the touch IDs and associate the color?

Also any details on how the scene is tracking a touch blob from frame to frame? Just curious there...

JonB

I believe ios tracks the touches, and correllates them to touch ids.
The touch structure that gets passed in is regenerated each time by the c code, so while you may be able to add to the dict, it won't persist across calls. So your idea of creating your own persistent dict (either global, or as an instance member of your scene class) sounds right.

Rothrock42

Thanks JonB. I'm still very new to python and wasn't sure if there was some "obvious" approach that I was missing.