JavaScript - setPointCapture, Snap to grid, Fixed to grid
JavaScript Coding
//void setPointCapture(view, mode)
//view: 1 for graphics, 2 for graphics 2, -1 for 3D.
//mode: 0 for no capturing, 1 for snap to grid,
// 2 for fixed to grid, 3 for automatic.
var pointCaptureFixed = ggbApplet.getValue("fixed");
if (pointCaptureFixed) {
ggbApplet.setPointCapture(1, 1);
ggbApplet.setValue("fixed", 0);
} else {
ggbApplet.setPointCapture(1, 2);
ggbApplet.setValue("fixed", 1);
}