// Copyright 2002 Matt Sandstršm/Too Much Too Soon // This script is freeware, meaning you may copy and // distribute it free of charge, as long as it's kept intact, // including this message. Feel free to use the code as // inspiration for your own scripts, but don't steal. // Email me at mattias@beauty.se if you have any questions. // Thank you. Have fun. generator "Clock", 120 group "Too Much Too Soon" AlphaType(kblack) FullFrame input tm, "Milliseconds", slider, 0, 0, 36000000; input shw, "Show", popup, 1, "HH:MM:SS:MMM", "HH:MM:SS:MM", "HH:MM:SS","MM:SS:MMM","MM:SS:MM","MM:SS(HH:MM)" input lead, "Leading Zero", checkbox, 1; input separator, "Separator", Text, ":"; input fontname, "Font", FontList, "", "str"; input fontsize, "Size", slider, 22, 8, 100 detent 22; input center, "Center", point, 0, 0; input fontcolor, "Font Color", color, 255, 255, 255, 255; code float a, d, w, h, i; point centeroftm, framesize, tmbox[4]; string tim, hours, minutes, seconds, ms; resetText; fontcolor.a = 255; dimensionsof(dest, framesize.x, framesize.y); fontsize /= 320/framesize.x; setTextFont(fontname); setTextSize(fontsize); setTextjustify(kcenterjustify); numtostring(Integer(tm/3600000)+lead*100, hours, 0); numtostring(Integer(tm%3600000/60000)+100, minutes, 0); numtostring(Integer(tm%60000/1000)+100, seconds, 0); numtostring(Integer(tm%1000)+1000, ms, 0); if lead == 1 then charsof(hours,1,3,hours); end if; charsof(minutes,1,3,minutes); charsof(seconds,1,3,seconds); if (shw==1||shw==4) then charsof(ms,1,4,ms); else charsof(ms,1,3,ms); end if; tim = ""; if (shw<4) then tim += hours+separator; end if; tim += minutes + separator + seconds; if (shw!=3&&shw!=6) then tim += separator + ms; end if; centeroftm = framesize; centeroftm *= center; measurestringplain(tim, w, h, a, d, aspectof(dest)); makerect(tmbox, centeroftm.x-w/2, centeroftm.y-a/2, w, a); drawstringplain(tim, tmbox, dest, fontcolor, aspectof(dest));