ビームインアウトスクリプト.anm
code:ビームインアウトスクリプト.anm
-- インターフェース
--track0:変化F数,0,300,15,1
--track1:変化秒数,0,5,0.25,0.01
--track2:揺らぎF,1,100,10,1
--track3:揺らぎ率,0,10,1.20,0.01
--dialog:登場Off/chk,local inOff=0;退場Off/chk,local outOff=0;秒で処理/chk,local sec=0;
-- 変数
local d_fr = obj.track0
local d_ti = obj.track1
local f_in = 0
local f_out = 0
local t_in = 0
local t_out = 0
local flfr= obj.track2
local fluc = obj.track3 - 1
local fr = obj.frame
local Tfr = obj.totalframe
local ti = obj.time
local Tti = obj.totaltime
local pi = math.pi
--[[ 変数の説明
d_fr...何フレームでインアウトするか
d_ti...何秒でインアウトするか
f_in...登場前のX拡大や透明度の割合
f_out...退場後のX拡大や透明度の割合
t_in...登場の進行度
t_out...退場の進行度
fr...オブジェクトの経過フレーム数
Tfr...オブジェクトの総フレーム数
ti...オブジェクトの経過秒数
Tti...オブジェクトの総秒数
]]
-- 処理
if( sec==0 ) then
t_in = (fr - d_fr)/d_fr + 1
if( t_in>0 ) then
if( t_in>1 ) then
t_in = 1
end
t_in = -t_in * t_in + 2 * t_in
f_in = t_in * 100
end
t_out = (Tfr - fr)/d_fr
if( t_out>0 ) then
if( t_out>1 ) then
t_out = 1
end
t_out = -t_out * t_out + 2 * t_out
f_out = t_out * 100
end
else
t_in = (ti - d_ti)/d_ti + 1
if( t_in>0 ) then
if( t_in>1 ) then
t_in = 1
end
t_in = -t_in * t_in + 2 * t_in
f_in = t_in * 100
end
t_out = (Tti - ti)/d_ti
if( t_out>0 ) then
if( t_out>1 ) then
t_out = 1
end
t_out = -t_out * t_out + 2 * t_out
f_out = t_out * 100
end
end
fl = ((fluc * math.sin(1.5 * pi + fr*pi/flfr)) + fluc) / 2 + 1
if( inOff==0 ) and ( outOff==0 ) then
Fa = (f_in + f_out - 100) * fl
obj.alpha = f_out/100
end
if( inOff==1 ) then
Fa = f_out * fl
obj.alpha = f_out/100
end
if( outOff==1 ) then
Fa = f_in * fl
obj.alpha = 1
end
if( inOff==1 ) and ( outOff==1 ) then
Fa = 100 * fl
obj.alpha = 1
end
obj.effect("拡大率","拡大率",100.00,"X",Fa)
タグ