Last active
September 20, 2021 12:24
-
-
Save istallia/f2b7bae73b598a529bbe5afe5fac344b to your computer and use it in GitHub Desktop.
図形の種類"背景"に適用してフェードイン・アウトを簡単に作るスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--track0:時間(s),0,10,0.5,0.01 | |
--track1:重み,0.01,6.00,2.00,0.01 | |
--check0:イン→アウト,0 | |
--dialog:フェードイン/chk,fade_in=1;フェードアウト/chk,fade_out=1; | |
local effect_time = obj.track0 | |
local power = 1.0 / obj.track1 | |
local is_in_out = obj.check0 == 1 | |
local t = obj.time | |
local tt = obj.totaltime | |
local alpha = 1.0 | |
if t < effect_time and fade_in == 1 then | |
alpha = math.pow(t/effect_time, power) | |
elseif tt - effect_time < t and fade_out == 1 then | |
t = t - tt + effect_time | |
alpha = (1.0 - math.pow(t/effect_time, power)) | |
end | |
if is_in_out then | |
alpha = 1.0 - alpha | |
end | |
obj.alpha = obj.alpha * alpha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
雑ですが設定項目の説明です
好きに使ってください