Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Alternative to Robot class? on: 2004-12-12 22:45:25
I think I'm going to give up on getting it to work properly on OS X.  I understand your code, and I'm actually doing something quite similar, but the accumulation is occuring in the Camera class, then every frame the Camera class is used to update the current view matrix.  I left out some important code on my post...

The problem is that on OS X, it really just is not recentering.  I noticed it before you helped me fix the cursor.  You could move the cursor to the side of the frame and it would stay there until you moved the mouse again.

Anyways, I appreciate your help very much.  I will investigate it more when I can, but for now, I need to focus on 'finishing' the game before Friday!!!



2  Game Development / Newbie & Debugging Questions / Re: Alternative to Robot class? on: 2004-12-11 23:31:47
Well, I have something similar...

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
public void mouseMoved(MouseEvent e)
{

  if (isRecentering && centerLocation.x == e.getX() && centerLocation.y == e.getY())
  {
    isRecentering = false;
  }
  else// legitimate mouse event
 {
    //get size of frame
   Dimension size = e.getComponent().getSize();
    centerLocation.x = size.width/2;
    centerLocation.y = size.height/2;


    //Calculate relative movement
   mouseX = e.getX() - centerLocation.x;
    mouseY = e.getY() - centerLocation.y;


    //Recenter mouse and 'disable' next mouse move
   isRecentering = true;
    robot.mouseMove(centerLocation.x, centerLocation.y);
                       
    }
}


Same idea I think.  The robot generates and event, which is ignored until it is finished recentering.  Like I said it works beautifully in Linux and Windows, but not OS X...

If you see a fatal mistake in mine, let me know...

Thanks!
3  Game Development / Newbie & Debugging Questions / Re: Alternative to Robot class? on: 2004-12-11 10:54:34
Sweet!  Two problems down in the last 15 minutes.  I simply moved the cursor removal method call after the requestFocus() call...working nicely. (The other problem was rebuilding joal to fix the endian-ness issue with os x)

Now if I can get the robot.mouseMove() from being so choppy, I will be a happy camper. It recenters the mouse, but only intermittently.  Since my  camera movement is relative to the center of the screen, it looks/runs horrible...

Anyways, thanks for the help!
4  Game Development / Newbie & Debugging Questions / Re: Alternative to Robot class? on: 2004-12-11 09:48:42
Well, I tried the suggestion for 'removing' the cursor, and I'm getting the same results.  I'm sure it's just OS X's Java implementation.  

No big deal, really, I'm developing/running on Linux and it's working quite well there.  I just wanted it to work on all platforms so I could demo it from my Powerbook.

I looked at JInput, but that may be a bit too much for one piece of functionality on one platform for a game that is due next Friday.

Thanks for the suggestions, though!  If you or anyone else have anymore, I'll give them a shot.
5  Game Development / Newbie & Debugging Questions / Re: Alternative to Robot class? on: 2004-12-11 06:38:46
Quote
>I'm working on a full screen 3D first person game for my
>class that utilizes the Java Robot class to recenter the
>mouse for camera movement.

Java3d huh? Well, bad luck.

> Also, removing the cursor on OS X doesn't work either,
>although the means of doing it seems like a hack anyways
>(setting the cursor image to an image that doesn't exist).

You actually set the cursor to an image, which is completely transparent.

setCursor(Toolkit.getDefaultToolkit().createCustomCursor(new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB),new Point(0,0),""));


Actually we're using JOGL... it's been pretty good to me.

Thanks for the cursor removal hint...the example I was working from was setting the cursor to an image that didn't exist, which seemed like a really bad way to go about it...
6  Game Development / Newbie & Debugging Questions / Alternative to Robot class? on: 2004-12-10 19:16:05
I'm working on a full screen 3D first person game for my class that utilizes the Java Robot class to recenter the mouse for camera movement.

However, the Robot class is awful on Mac OS X.  It works well on Linux and Windows...  Are there any other ways around using the Robot class?

Also, removing the cursor on OS X doesn't work either, although the means of doing it seems like a hack anyways (setting the cursor image to an image that doesn't exist).

Any help would be greatly appreciated....
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (6 views)
2014-07-29 12:53:52

Dwinin (7 views)
2014-07-29 10:59:34

E.R. Fleming (21 views)
2014-07-29 03:07:13

E.R. Fleming (8 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (51 views)
2014-07-17 23:47:54
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!