Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I have a questions just like the title.

In my program, there are three functions to handle each control action.(ctrl_mousedown, ctrl_mousemove, ctrl_mouseup)
But, they are only to handle one control in a time.

Now, I don't know how to write the function moving more than two cards at the same time.

Please help me to solve this problem.

Thanks!
Posted
Updated 27-Nov-10 1:56am
v2

1 solution

If you are trying to write your own game, then it's not too bad. In your MouseDown handler, check if anything is currently selected.
If it is, check if you are over a selected item - if so, then this is the start of a move.
Otherwise, check if shift or control are down - if so, then you are adding cards to the selected list. If not, then select the card under the mouse, and deselect all the others.

In mouse move / up check if you are moving.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900