Colors and Random NumbersTopAnnouncementsDragging

Dragging

It turns out that a lot of games and other animations involve dragging objects around the screen: Click on SimpleDrag to show the example.

That example didn't give a good solution for dragging. Click on BetterDrag for a better solution.

Note that to determine if we are dragging or not, we need to check if the point before dragging was in the object. We can do even better if we introduce a variable holding a value of type Boolean EvenBetterDrag


Colors and Random NumbersTopAnnouncementsDragging