Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Multitouch passes through upper containers (Build2018.24410)

Report bugs so we can squash them!

Multitouch passes through upper containers (Build2018.24410)

Postby Ebee » Wed Jul 11, 2018 3:59 am

(WIN10 Build 2018.24410 or earlier.)

I hope multitouch works like the same as 'panel' , but currently multitouch always passes through upper containers.

Is that difficult to fix ?

Sorry for posting about multitouch again and again, but this would be my last topic.
Attachments
mtouchbug.toe
(29.96 KiB) Downloaded 19 times

[ Play Quicktime file ] mtouchdemo.mp4 [ 1.11 MiB | Viewed 575 times ]

Ebee
 
Posts: 11
Joined: Wed May 23, 2018 12:01 am

Re: Multitouch passes through upper containers (Build2018.24

Postby Achim » Thu Jul 12, 2018 2:32 pm

Having the same issue

Cologne area TD artists? Let’s get in touch

Achim
 
Posts: 1673
Joined: Wed Nov 14, 2007 1:52 pm
Location: Cologne

Re: Multitouch passes through upper containers (Build2018.24

Postby selina » Fri Jul 13, 2018 12:11 pm

So in the sample file posted, the green and red panel each have a multiTouch In DAT. The DAT takes in all touch events and passes them to the panel if it is inside the panel, they do not talk to each other. You'll want a single multi touch in DAT to point to the parent panel of the 2 panels. Hope this helps.
User avatar
selina
Staff
 
Posts: 808
Joined: Tue Nov 13, 2007 1:15 am

Re: Multitouch passes through upper containers (Build2018.24

Postby Ebee » Sun Jul 15, 2018 3:36 am

Hi, Selina.
Could you correct my toe file ?
I'm so confused.
Ebee
 
Posts: 11
Joined: Wed May 23, 2018 12:01 am

Re: Multitouch passes through upper containers (Build2018.24

Postby raganmd » Sun Jul 15, 2018 6:00 pm

hi Ebee,

I think what selina is saying is that in using the multitouch DAT you become responsible for determining where the user has pressed, and what to do with that information.

Take a look here:
multi_touch_example.tox
(1.21 KiB) Downloaded 22 times


In modifying your example I used a single multitouchinDAT for the container holding both red and green squares. The callbacks DAT is modified to hold three dictionaries that represent the uv boundaries of the boxes:

Code: Select all
green_boudnds   = {
                    "x_min"     : 0.043,
                    "x_max"     : 0.64,
                    "y_min"     : 0.61,
                    "y_max"     : 0.97
                }
red_bounds      = {
                    "x_min"     : 0.28,
                    "x_max"     : 0.87,
                    "y_min"     : 0.54,
                    "y_max"     : 0.88
                }
overlap_bounds  = {
                    "x_min"     : 0.28,
                    "x_max"     : 0.627,
                    "y_min"     : 0.625,
                    "y_max"     : 0.88
                }


Another function is added to test if a set of u, v vals is inside of a vals provided by one of those dictionaries:

Code: Select all
def bounds_check(downu, downv, min_max_dict):
    inside_test         = False

    x_min   = min_max_dict.get('x_min')
    x_max   = min_max_dict.get('x_max')
    y_min   = min_max_dict.get('y_min')
    y_max   = min_max_dict.get('y_max')

    # check u
    if downu > x_min and downu < x_max:
        # check v
        if downv > y_min and downv < y_max:
            inside_test = True

    return inside_test


In your onDown() call you then check the input val against the objects. From here you can decide what to do with the results. You can see that I've added an example to change the alpha of the different boxes:

Code: Select all
    if inside_both:
        both_box.par.bgalpha    = 1
    elif inside_green:
        green_box.par.fillalpha = 1
    elif inside_red:
        red_box.par.fillalpha   = 1


Does that help?
raganmd
 
Posts: 1296
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: Multitouch passes through upper containers (Build2018.24

Postby Ebee » Mon Jul 16, 2018 4:35 am

Hi, Matthew.
You are a super kind guy as always.
Thank you for your help !

I understand what you and Selina mean, but it would be more and more complicated if I
want to build complex UIs with a lot of floating containers.
I wish a simpler solution like panelCHOP or panelExec DAT would be added.

Anyone please let me know if some advice.
Ebee
 
Posts: 11
Joined: Wed May 23, 2018 12:01 am


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests