• Post Reply Bookmark Topic Watch Topic
  • New Topic

A few problems with the Custom Cursor

 
Olivier Legat
Ranch Hand
Posts: 176
Chrome Mac Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy folks,

I'm trying to get some good custom cursors up and running but I'm not into a few problems.

Firstly, I use createCustomCursor to create my cursors but I notice it doesn't allow you to define the type of cursor (kind of like how Cursor(int) lets you do). This is annoying because I want to create cursors which have to origin at the center rather at top-left corner, like with a move or crosshair cursor instead of an arrow pointer. Right now my custom move has the origin on the top-left corner, which makes it feel very odd. How can a tweak my custom cursors to do this?

Also I've noticed that the Cursors are much too large on Windows whereas they're just fine on Mac OS X. How can I fix this without tampering the Mac version? NOTE: I'm using 256x256 images which I resize to 16x16 in getIcon(Icon, int). Is this a bad idea? You save them into separate 16x16 files instead?

Here's the code (it's kind of long-ish, line 104-133 are what's important though)


Thanks
 
Olivier Legat
Ranch Hand
Posts: 176
Chrome Mac Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I think I know how to fix the first problem actually

I've added this method:


Could someone please confirm to me that the "hotPoint" is essentially the origin of the cursor?
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The hotpoint is the point (x,y) inside the image that will determine the point of the MouseEvent when you click somewhere. I don't know if that's what you meant with "origin".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!