CMPT 166 Lecture Notes - Lecture 18: Thedraw, Ellipse

29 views7 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents