- UID
- 702
- 积分
- 1002
- 帖子
- 241
- 主题
- 12
- 论坛币
- 2292
- 威望
- 2
- EP值
- 520
- MP值
- 0
- 阅读权限
- 50
- 注册时间
- 2012-9-9
- 在线时间
- 281 小时
- 最后登录
- 2014-4-1
|
渣渣疯子 发表于 2012-9-13 21:25
def是定义函数。。。做特效也是会用到的,不过刚才那个是提供模块的...恩,晚安~ ...
呜咕。。V。。问一下。。那个。。就这两个特效偶想把它们链接起来。。。就是第一个特效结束后,用第二个效果消失0.0。。- from tcaxPy import *
- def tcaxPy_Init():
- global _FD # frame duration, in millisecond
- global _Fs
- global _Blur
-
- _Blur = GetVal(val_Blur)
- _FD = 1000 / GetVal(val_FXFPS)
- _Fs = GetVal(val_FontSize)
- def tcaxPy_Fin():
- pass
- def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
- ASS_BUF = [] # used for saving ASS FX lines
- TCAS_BUF = [] # used for saving TCAS FX raw data
- _7X = _x - int(_a / 2 + 0.5) # 第i句卡拉OK歌词的j个字符的左上角X轴坐标
- _7Y = _y - int(_Fs / 2 + 0.5)
- ts = _start + _elapk # start time, in semi-second
- te = _end
- for i in range(0,_a,3):
- for j in range(0,_Fs,3):
- COLOR=[ "696AFF", "FF9C69","69EBFF","A5BDED","C9F2DC" ]
- COLOR1=color1(COLOR[randint(0,4)])
- R = randint(-10,10)
- Xx1 = randint(-50,50)
- Yy1 = randint(-30,30)
- MOVE1 = move(_x+Xx1,_y+Yy1,_x,_y,0, 10 * _k)
- CLIP1 = clip(_7X+i+Xx1,_7Y+j+Yy1,_7X+i+3+Xx1,_7Y+j+3+Yy1)+t(0, 10 * _k,clip(_7X+i,_7Y+j,_7X+i+3,_7Y+j+3))
- if _Blur > 0:
- EFT = MOVE1+CLIP1+fad(100,0)+COLOR1+blur(_Blur)
-
- ass_main(ASS_BUF, SubL(ts+R, te), EFT, _txt) # store the effect
- return (ASS_BUF, TCAS_BUF)
复制代码 这个代码是EFT的效果。。偶想与下面的这个“出”特效时间链接起来。。- from tcaxPy import *
- def tcaxPy_Init():
- global _FD # frame duration, in millisecond
- global _Fs
- global _Blur
- _FD = 1000 / GetVal(val_FXFPS)
- _Fs = GetVal(val_FontSize)
- _Blur = GetVal(val_Blur)
- def tcaxPy_Fin():
- pass
- time_gap = 1 # you can change this value to 0, or 2 or any other number
- time_fac = 1 # you can change this value to 0, or 2 or any other number
- def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
- ASS_BUF = [] # used for saving ASS FX lines
- TCAS_BUF = [] # used for saving TCAS FX raw data
- duration = 10 * _FD
- ts = _end - (_n - _j ) * time_fac * _FD / 10 + time_gap * _FD / 10
- te = _end - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 + duration / 10
- for i in range(0,_a,3):
- for j in range(0,_Fs,3):
- COLOR=[ "696AFF", "FF9C69","69EBFF","A5BDED","C9F2DC" ]
- COLOR1=color1(COLOR[randint(0,4)])
- EFT = move(_x, _y, _x - int(1.2 * _Fs), _y + int(_Fs / 2)) + fad(0, duration) + COLOR1
- if _Blur > 0:
- EFT += blur(_Blur)
- ass_main(ASS_BUF, SubL(ts, te), EFT, _txt)
- return (ASS_BUF, TCAS_BUF)
复制代码 呜咕。。偶试过该消失那个特效的时间。。。可是改了。。要么就是错误。。要么就是效果不好(T.T) |
|