Here is an example from Mathematica's help:
Manipulate[Graphics[Polygon[pt], PlotRange -> 2],
{{pt, {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {1, -1}}}, Locator}]
When I execute this, I can drag any Locator
, and the Polygon
changes.
Is there a way to access which element of pt
is being dragged? So I could have a line in the code that does something different while different points are being dragged? Something like:
Manipulate[doSomethingIfPt2IsBeingDragged;Graphics[Polygon[pt], PlotRange -> 2],
{{pt, {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {1, -1}}}, Locator}]