The Draggable Box - Take 3
June 7th, 2008
Just a minor fix to the draggable box I made the other day. Previously it positioned the box so that the top-left corner was aligned with the mouse. Now, it centres the box horizontally and vertically behind the mouse.
It is available online here along with the full source code.
The changes made to fix this are pretty simple, and the code changes are shown below.
The Draggable Box - Take 2
June 4th, 2008
As I mentioned on my previous version of the Draggable Box, I had not gotten it to retain the size or position of the box when the mouse buttons were released.
Using the mouseDragged() function, I have now fixed this.
The box no longer reverts back to moving around the screen and adjusting its size on it’s own. It stays whatever size and in whatever position the user places it.
It is available online here. Click and drag with the left mouse button to move the box, or click and drag with the right mouse button to change the size. Horizontal movement affects the width and vertical movement affects the height.
