• Advertisement
Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65736

Mouse support!

Sign in to follow this  

79 views

Alright, I've got a Mouse->Keyboard emulator going! Now what this does is takes the cursor's move events and processes them into the keyboard class. This is handy so that in my State object I can just assign the hotkey like I would if it were a keyboard. No extra coding to get the mouse to scroll (outside of the mouse class that is...)

I am having some compatibility issues with changing the cursor on the JFrame... when I set it to a custom BufferedImage on my mac everything displays really well. When I load it up under XP or 2K the sword image looks scrunched and the move image looks blown up... Is there a default size for custom cursors in Windows?

The next thing on the list is to get a TextTracker object going, and get my message boxes working. From there I add support for my new Mp3 sound file, and then animations and paths (movement events) for the actors.

But I was really happy that I could get this mouse working!
Sign in to follow this  


4 Comments


Recommended Comments

Well, if all else fails you could set a blank picture for the mouse and then just display the sword image centered at the mouse coordinates using the graphics context. Though it would be a bit more coding. I don't know of any size limit on windows custom cursors. Though it might have something to do with the image format that you are using for the cursor image.

Share this comment


Link to comment
I believe the default size is 16x16 or 32x32. I don't remember which. AFAIK, there's no maximum size...

Share this comment


Link to comment
Maybe they have to be square... I'll go and check that out right now...

-edit-

Yup, changing it to a 32x32 made it not do the funny cursor thing. [smile]

Thanks!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement