Forums > Jitter

Creating a click and drag area selection tool– Couple probably easy ?s

Dec 03 2013 | 10:46 pm

I’m working on an aspect of an application of mine, where rectangular sections of a jit.pwindow can be selected by the user and i want a semi-transparent cursory box to appear while the selection is being made, much like when you click and drag in the Max editor itself. This is what i have so far:

-- Pasted Max Patch, click to expand. --


I’m using another jit.pwindow as the cursor. Question 1:

-How do you affect the transparency of a matrix? I can’t seem to figure it out.

The main problem here is that mousestate reports the absolute position and not the position relative to the patcher window. Question 2:

-How can i get the position of the patcher window so i can make an adjustment? Or how can i get mousestate to report relative positions?

So i suppose question 3 is:

-What do the veterans think of my concept and approach?

Dec 04 2013 | 2:36 am

mousestate mode 1 gives you the relative position you’re looking for. See the help file.
Anyway, I don’t know if the content of the jit.pwindow is OpenGL or video but, I would do the rectangular selection drawing inside it, not superimpose another pwindow. But if you really want to pursue that approach, why not use [panel] instead? You could use transparency then…

Dec 04 2013 | 6:06 pm

Thanks for the tips. Yeah I suppose I might as well do it that way, since I’m going to have manipulate the matrix based on the user’s selection anyway. I’m working with just static images, no video.

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > Jitter