omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Touches

    Pythonista
    2
    3
    2193
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Rothrock42
      Rothrock42 last edited by

      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...

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • Rothrock42
          Rothrock42 last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors