Advertisement Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

Mouse support!

Sign in to follow this  


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  


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...


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


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

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!