Poll

Mouse Movement In JPCTDemo.java Type example

Mouse Movements
0 (0%)
Mouse Mapper
1 (100%)

Total Members Voted: 1

Author Topic: Mouse Movement  (Read 5922 times)

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Mouse Movement
« on: March 16, 2007, 06:41:53 am »
Hi
   I am trying to implement Mouse in JPCTDemo.java type example Plz can any one help me out with suggesions or example.


With Regards
San
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Mouse Movement
« Reply #1 on: March 16, 2007, 08:02:58 am »
What's the purpose of this strange poll? Anyway...basically, you've to make the mouse to be placed in the center of the screen and get the deltas in x and y direction for each frame. Divide this deltas by some value that fits your needs and your mouse speed and rotate the camera accordingly around the x- (for up/down) and y- (for left/right) axis. Then reset the mouse back to the center.
To do this in OpenGL mode, LWJGL has a mouse class. To do this in AWT/Swing, usw java.awt.robot and calculate the deltas yourself. The Paradroidz-sources include a mouse mapper that should handle most of this (the mouse management, not the rotation of the camera itself of course).

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Re: Mouse Movement
« Reply #2 on: March 16, 2007, 09:51:23 am »
Sorry for that. I did it by mistake.(Poll).

Paradroidz-sources

I tried to run but It gives message Texture not found. From where can i find texture.


With Regards
san
San14

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Mouse Movement
« Reply #3 on: March 16, 2007, 11:04:39 am »
From the actual download of the game. But that's not the point. Just have a look at  the MouseMapper. No need to run the game for this.

Offline san14

  • int
  • **
  • Posts: 60
    • View Profile
Re: Mouse Movement
« Reply #4 on: March 19, 2007, 01:40:33 pm »
Hi EgonOlsen


    I have extended MouseMapper to my JPCTDemo.java type example. I could get couse click and mouse draged. But I am not able to zoom in environment and turn in environment.
I get this error.


Software renderer disposed
Software renderer (OpenGL mode) initialized
117-133 -> using splitted buffer access!
Can't find desired videomode (850 x 500 x 32) - searching for alternatives
[ Mon Feb 19 06:17:32 PST 2007 ] - ERROR: Can't find any suitable videomode!
[ Mon Feb 19 06:17:32 PST 2007 ] - ERROR: Can't set videomode - try different settings!
Software renderer disposed
[ Mon Feb 19 06:17:32 PST 2007 ] - WARNING: Couldn't create LWJGL-mouse - initialize the OpenGL renderer first!


Can you suggest me how to use mouse for movement in to JPCTDemo.java type example.

With Regards
San
San14

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: Mouse Movement
« Reply #5 on: March 19, 2007, 03:39:08 pm »
850x500 is not a supported resolution, with sw rendering you can asign any size but OpenGL has predefined video modes like 800x600 or 1024x768. If you want to get the list of  supported video modes you can get them using the jpct API.
Nada por ahora

Offline Mr.Marbles

  • int
  • **
  • Posts: 81
    • View Profile
Re: Mouse Movement
« Reply #6 on: April 02, 2007, 03:00:29 pm »
I just came across this thread while searching for a mouse input solution which would satisfy both hardware and software rendering modes (since my AWT MouseEventListeners are useless in hardware). Is there a reason why the MouseMapper in Paradroidz hasn't be added to the latest release of jPCT? It seems like a natural thing to have in the library since KeyMapper is already there. Just a thought...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Mouse Movement
« Reply #7 on: April 02, 2007, 05:58:48 pm »
Is there a reason why the MouseMapper in Paradroidz hasn't be added to the latest release of jPCT? It seems like a natural thing to have in the library since KeyMapper is already there. Just a thought...
There was a reason for not adding it, but i can't remember it... ??? I may add it to a future release.

Offline ToddMcF2002

  • long
  • ***
  • Posts: 103
    • View Profile
Re: Mouse Movement
« Reply #8 on: April 05, 2007, 07:26:56 pm »
If you are going to add it - please add a wrapper for CustomCursor that implements both Rendering paths.

I had a pretty harrowing time getting the lg renderer to accept the transparency and orientation of my GIFs - which also affects the offset to 2D x and y if you decide to give up and invert the GIFs like I did.