Forums Register Login

'Shuffling' GUI fx using Mouse Motion Event listener code

+Pie Number of slices to send: Send
Dear Programmers,
I wanted to code a program that would use a mouse motion cursor activated listener so that images on a GUI wouldn't just change once, but go through a sequence of changes for as long as the mouse is left upon a particular square or area of the GUI.

I wanted to create a 'shuffling' of cards effect - so that if the cursor were moved one square - it'd go through the entire suite from say 2 of Diamonds, through 3,4,5,6,7,8,9,10,Jack, Queen, King, Ace, then proceed to 2 of say Hearts, and so on.

If the cursor were moved to another square in the GUI - the same sequence would be gone through, until the cursor were moved, in that way each time the cursor is shifted around the GUI, the GUI would display a different set of cards - as each square therin would stop its 'shuffling' sequence at a particular card, once the cursor had left it.

Anyhow, that is my concept. I would like to know if any of you could suggest some useable code out there, for instance in a tutorial on the net, that does something like this - ie display an image sequence (than just one color change) in response to a mouse motion event.

Obviously it would use Action Performed/ Listener Event code, but my present knowledge can only accomplish the aforementioned one color change as an event response.

If you could give me some leads I would be very pleased.

Thank you for your attention

Yours
Simon
+Pie Number of slices to send: Send
It sounds to me like game programming, this is just one site of many that talk about using mouse events in a game. It's a start. Good Luck!
+Pie Number of slices to send: Send
Dear Larry Frissell,

Dear
Thank you for your response.

I don't think I have explained what I had in mind as clearly as I might have, in restrospect.

The changing sequence of images I had in mind, don't have to be the sequence of a pack of cards, it could be any sequence of images - road signs, the alphabet, sephamore, or heiroglyphs even.

All I want is for the mouse motion event to do is to go through a sequence (be they predetermined or random) of stored images, rather than making just one image - or colour appear upon shifting the mouse cursor over that listener enabled area of the GUI.

At present I know how to make a colour appear upon shifting the mouse over it - but I want something a bit more spectacular ie: the presentation of an image, and preferably a sequence of images, until the mouse is moved off that listener enabled area of the GUI.

I've looked at the site you recommended, but that, as you suggested is about making a game (a ping pong game) which isn't really what I had in mind. I think what I have in mind is much simpler than Game design (ie game design is far too advanced for me or what I have in mind at present).

If you, or anyone can give me advice, again I would be grateful.

Thanks for your assistance.

Yours

Simon.
+Pie Number of slices to send: Send
There appear to be answers on another thread; in view of the similarity of the questions, I am closing this thread; please continue discussions on the other thread.
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


Reply locked
This thread has been viewed 1634 times.
Similar Threads
check my code please?
Mouse Motion Listener
Graphics and Swing??
Mouse shift event code to present a sequence of images on GUI
Wait Cursor
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:10:09.