Dragging objects with Mouse
I am making a sound board and I am having trouble with dragging objects. I want you to be able to drag little boxes with words in them to a line so you can play them, but I don't know how you would make it so that you are able to drag them. Does anyone know how to do this?
Re: aking a souDragging objects with mouse
Set a flag/alterable value on the object when it's clicked on (using the "Repeat while mouse key is held" condition), and move it to the position of the mouse cursor or object when this flag is on. At the end of the event list, continually set the flag off so that when the mouse button isn't being held, the object no longer follows the mouse.
Re: aking a souDragging objects with mouse
Alright I am a little confused so I have this "Repeat will left mouse key is pressed" but, What to I do with the flags and alternate values?
Re: aking a souDragging objects with mouse
What number flag is it and what number should i set alternate value A to?
Re: aking a souDragging objects with mouse
You don't need to use a specific flag or set a value to anything in particular - just something that you can recognize later. For example:
+ Mouse is over object
+ User clicks with left button
-> Set flag 0 of object to ON
+ Flag 0 of object is on
-> Set object's position to (MouseX, MouseY)
X (Negated) Repeat while user is holding left button
-> Set flag 0 of object to OFF
I think that should do it.
Re: aking a souDragging objects with mouse
Thanks a ton works perfectly!