I
Icarus
I am currently working on creating a game platform where one can pick
up tokens of various shapes and place them on a game board. For
precise placement, I need an image of these tokens in their original
size to be moving around with the mouse cursor until the token is
placed on the board.
My initial approach was to convert the token into an original-sized
picture and setting this picture as mouse cursor. However, my system
determines a maximum size for custom cursors which is far too small
for my needs.
Now I am at a loss. My idea now is to draw the picture on the
GlassPane of my current JFrame and move it according to
MouseMotionEvents. But that seems to be the most performance-heavy
solution there is.
I have found an example on http://weblogs.java.net/blog/gfx/archive/2005/10/drag_and_drop_e.html,
but it comes with no direct explanation of the steps involved and is
published under a license I don't want to have in my program. However,
without understanding the steps involved, I can only copy the code,
thus violating the license agreements.
So I want to ask you:
- What would be the most effective way of (visibly) moving objects
around with the mouse cursor on the GlassPane?
- Or: Can you think of any other way how this could be accomplished?
I would be really grateful for any pointers in the right direction. As
this problem creeped up right at the end of my project, my timetable
is messed, I have 3 weeks for solving the problem, testing it and
fixing up the documentation, I am quite on edge at the moment.
up tokens of various shapes and place them on a game board. For
precise placement, I need an image of these tokens in their original
size to be moving around with the mouse cursor until the token is
placed on the board.
My initial approach was to convert the token into an original-sized
picture and setting this picture as mouse cursor. However, my system
determines a maximum size for custom cursors which is far too small
for my needs.
Now I am at a loss. My idea now is to draw the picture on the
GlassPane of my current JFrame and move it according to
MouseMotionEvents. But that seems to be the most performance-heavy
solution there is.
I have found an example on http://weblogs.java.net/blog/gfx/archive/2005/10/drag_and_drop_e.html,
but it comes with no direct explanation of the steps involved and is
published under a license I don't want to have in my program. However,
without understanding the steps involved, I can only copy the code,
thus violating the license agreements.
So I want to ask you:
- What would be the most effective way of (visibly) moving objects
around with the mouse cursor on the GlassPane?
- Or: Can you think of any other way how this could be accomplished?
I would be really grateful for any pointers in the right direction. As
this problem creeped up right at the end of my project, my timetable
is messed, I have 3 weeks for solving the problem, testing it and
fixing up the documentation, I am quite on edge at the moment.