// This example action tool uses the Toolbar.setIcon() // method,added in v1.53h, to dynamically update its icon. // Uses extended hex coordinates to create 24x24 icons. // Click "Install", or type ctrl+i, to add this tool to the // toolbar. The animation starts after you click three times // on the tool icon. // Author: Jerome Mutterer var icons = newArray("C037N44V55cc","C037N44V33gg","C037N44V00nn"); var colors = newArray( "Cf00","C0f0","C00f","Cf0f","Cff0","C0ff"); var xs = newArray(6); var ys = newArray(6); var xbs = newArray(6); var ybs = newArray(6); var state = 1; macro "Animated Icon Action Tool - C037N44V55cc" { if (state=23)) vx = -vx; if ((y<1)||(y>=23)) vy = -vy; bx=bx+vbx; by=by+vby; if ((bx<1)||(bx>=23)) vbx = -vbx; if ((by<1)||(by>=23)) vby = -vby; call("ij.gui.Toolbar.setIcon", "Animated Icon Action Tool", getIcon(x,y,bx,by)); wait(100); } } function getIcon(i,j,k,l) { xs = Array.slice(xs,1,6); xs = Array.concat(xs,i); xbs = Array.slice(xbs,1,6); xbs = Array.concat(xbs,k); ys = Array.slice(ys,1,6); ys = Array.concat(ys,j); ybs = Array.slice(ybs,1,6); ybs = Array.concat(ybs,l); icon = "N44"; for (z=0;z15) return fromCharCode(0x66+n-15); else return toHex(n); } function constrain(a,min,max) { if (amax) a=max; return a; }