Tracking a mouse's co-ordinates inside a jit.window


    Apr 30 2008 | 4:55 pm
    I thought i had this nailed and then i hit fullscreen mode and whoosh new problems
    Neways i was wondering if there is anyway of tracking a mouse's x and y values within a jit.window and only in that jit.window as well as having the x and y values not changing in fullscreen mode or on diffrent monitors.
    I know its a bit of a tall order but there must be some sort of way round this problem
    Thanks for any help you can give guys

    • Apr 30 2008 | 5:55 pm
      > I thought i had this nailed and then i hit fullscreen mode and whoosh new problems > >
      Are you using the mouse output from jit.window?
      > Neways i was wondering if there is anyway of tracking a mouse's x and y values within a jit.window and only in that jit.window as well as having the x and y values not changing in fullscreen mode or on diffrent monitors. >
      You'll have to at least scale them according to windows size. jit.window outputs window coordinates
      wes
    • May 01 2008 | 4:21 pm
      Yes. This works fine on a small window. But when i go to fullscreen the x and y values shoot up. Obviously due to the increased screen size. But is there any way to stop that at all
    • May 01 2008 | 6:22 pm
      yes, when you go to fullscreen, send the coordinates to a [scale] object to confine the output to the same min and max coordinates that you were using in the pwindow. if the x/y of the first window was 320 240, and the x/y of fullscreen is 800 600, then you'll use two scales. for the x - [scale 0 800 0 320] y - [scale 0 600 0 240]
    • May 02 2008 | 2:28 am
      or use a separate pwindow for your mouse interaction
    • May 02 2008 | 11:34 am
      Quote: bryanteoh wrote on Thu, 01 May 2008 12:22 ---------------------------------------------------- > yes, when you go to fullscreen, send the coordinates to a [scale] object to confine the output to the same min and max coordinates that you were using in the pwindow. if the x/y of the first window was 320 240, and the x/y of fullscreen is 800 600, then you'll use two scales. for the x - [scale 0 800 0 320] y - [scale 0 600 0 240] > > ----------------------------------------------------
      ah this is true. But the problem is if i then move to say my laptop the full screen scale will be wrong. Or is there away of just cementing the fullscreen at a certain resolution. Like it is always 800 600 at fullscreen. Or if not a way of adjust the scale for several diffrent screen resolutions
    • May 02 2008 | 1:05 pm
      Here is another approach
      If you make any use of jit.gl.render in your patch try using the screentoworld method and pasing the mouse window x,y coordinates as agruments 1 and 2, then just route screentoworld out of the jit.gl.render dump, and you'll get normalized coordinates for your mouse x,y (and z!) position.
      JS
      On 30-Apr-08, at 12:55 PM, David wrote:
      > > I thought i had this nailed and then i hit fullscreen mode and > whoosh new problems > > > Neways i was wondering if there is anyway of tracking a mouse's x > and y values within a jit.window and only in that jit.window as > well as having the x and y values not changing in fullscreen mode > or on diffrent monitors. > > I know its a bit of a tall order but there must be some sort of way > round this problem > > Thanks for any help you can give guys
    • May 02 2008 | 1:08 pm
      Here is another approach
      If you make use of jit.gl.render in your patch try using the screentoworld method by passing the mouse x,y coordinates from the jit.window as agruments 1 and 2, then just route screentoworld out of the jit.gl.render dump, and you'll get normalized coordinates for your mouse x,y (and z!) position.
      JS
      On 30-Apr-08, at 12:55 PM, David wrote:
      > > I thought i had this nailed and then i hit fullscreen mode and > whoosh new problems > > > Neways i was wondering if there is anyway of tracking a mouse's x > and y values within a jit.window and only in that jit.window as > well as having the x and y values not changing in fullscreen mode > or on diffrent monitors. > > I know its a bit of a tall order but there must be some sort of way > round this problem > > Thanks for any help you can give guys
    • May 02 2008 | 1:47 pm
      Something else I've done in the past is taken the dim from jit.display dumpout if you need to change scale items and automatically detect the settings of new computer screen to change your objects (I think you mentioned scale?). It's also useful if you have multiple screens (such as a projector) and don't know what the resolution is.