Skip to content

Instantly share code, notes, and snippets.

@code404
Created July 30, 2012 18:24
Show Gist options
  • Save code404/3208918 to your computer and use it in GitHub Desktop.
Save code404/3208918 to your computer and use it in GitHub Desktop.
AviUtl拡張機能用のカウントダウン/アップを表示するカスタムオブジェクト。時間を扱うので進行速度は一定。カウント目的のため分までしか表示なし。拡張子をobjにして使用。
--track0:サイズ,1,256,34
--track1:表示形式,0,5,0,1
--track2:ダウン/アップ,0,1,0,1
--check0:小数点以下小文字,1
--dialog:フォント名,font="MS UI Gothic";文字色/col,col1=0xffffff;影・縁色/col,col2=0x000000;装飾タイプ,deco=0;
-- 0=2.23 1=02.23 2=00:02.23 3=2 4=02 5=00:02
if(math.floor(obj.track2) >= 1) then
sec = obj.time
else
sec = obj.totaltime - obj.time
end
mode = math.floor(obj.track1)
if(mode == 1 or mode == 4) then
str = string.format("%02d", sec)
elseif(mode == 2 or mode == 5) then
str = string.format("%02d:%02d", sec / 60, sec % 60)
else
str = string.format("%d", sec)
end
if(mode < 3) then
str = str .. "."
if(obj.check0) then
small = math.floor(obj.track0 * 3 / 4)
str = str .. "<s" .. small .. ">"
end
str = str .. string.format("%02d", (sec * 100) % 100)
end
obj.setfont(font,obj.track0,deco,col1,col2)
obj.load('text',str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment