CMPT 166 Lecture Notes - Lecture 18: Thedraw, Ellipse
Document Summary
In these notes you will learn: how to implement drag-and-drop using the mousedragged function, how to drag an object while keeping the mouse pointer fixed on the drag point. A standard user interface effect is dragging an object around the screen by clicking and holding it. For example, in a window interface you can delete a file by dragging its icon into a trash bin. In this note we will see how to implement basic drag-and-drop in processing. Let"s write a program that lets the user drag a ball around the screen. To be clear, let"s say exactly what we mean by dragging and dropping. Dragging means that the user clicks the mouse pointer somewhere on the ball and then, while still holding the mouse button down, moves the mouse. The dropping part occurs when the user releases the mouse button, and the circle detaches from the pointer and stays where it is.