- UID
- 319
- 积分
- 3718
- 帖子
- 260
- 主题
- 10
- 论坛币
- 1147
- 威望
- 29
- EP值
- 628
- MP值
- 5
- 阅读权限
- 80
- 注册时间
- 2012-2-26
- 在线时间
- 222 小时
- 最后登录
- 2019-1-1
|
本帖最后由 忘却の小伊 于 2014-7-15 23:11 编辑
以前做的,今天刚好有人问我要脚本,我还以为扔了,现在补上- from tcaxPy import *
- def tcaxPy_Init():
- global _FD # frame duration, in millisecond
- global _Fs
- _FD = 1000 / GetVal(val_FXFPS)
- _Fs = GetVal(val_FontSize)
- def fr(x):
- X = randint(-x,x)
- return frx(X)+fry(X)+frz(X)
- def frin(x):
- X = randint(30,x)
- return frx(X)+fry(X)+frz(X)
- 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
- _BL = blur(4)
- CL=[ "26B1FD", "CECECE","C8E787","6883FF","FCD8AF","A9E096","AF7BFF","FA6CA7","FC8769","F596EE" ]
- shape = ["{\p1}m 0 0 l 0 0 l 0 0 l 0 9 b 0 9 -1 8 -3 9 b -3 9 -5 10 -4 12 b -4 12 -3 13 -1 12 b -1 12 1 11 1 10 b 1 10 1 9 1 9 l 1 1 b 2 2 3 2 2 6 b 5 2 2 1 1 0 {\p0}","{\p1}m 0 0 l 0 0 l 0 7 b 0 7 0 6 -1 7 b -1 7 -3 8 -2 9 b -2 9 -1 10 0 9 b 0 9 1 8 1 8 b 1 8 1 7 1 7 l 1 1 l 7 0 l 7 6 b 7 6 6 5 5 6 b 5 6 3 7 4 8 b 4 8 5 9 6 8 b 6 8 8 8 8 7 b 8 6 8 6 8 6 l 8 -1 {\p0}"]
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
- ASS_BUF = [] # 保存ASS特效
- TCAS_BUF = [] # 保存TCAS特效
-
-
- duration = 10 * _FD
- in_ts = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10 - duration / 10
- in_te = _BT + _j * time_fac * _FD / 10 - time_gap * _FD / 10
-
- out_ts = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10
- out_te = _ET - (_n - _j - 1) * time_fac * _FD / 10 + time_gap * _FD / 10 + duration / 10
-
- if _i < 9 or _i ==14:
- #################进入方式#################
-
- in_EFT = move(_x+30, _y-30,_x,_y)+fsc(70,70)+frin(70)+t(fsc(100,100)+fr(0))+ fad(duration, 0) + _BL
- ass_main(ASS_BUF, SubL(in_ts, in_te), in_EFT, _txt)
- #################表现效果#################
- ass_main(ASS_BUF, SubL(in_te,_BT+_SK),pos(_x,_y)+_BL,_txt)
- ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT/2),pos(_x,_y)+_BL+t(fsc(80,80)),_txt)
-
- if _i < 4 :
- _COLOR = color1("HFC8769")+color3("FFFFFF")+color4(CL[randint(0,9)])
-
- if _i > 3 and _i<7 :
- _COLOR = color1("HFF42FF")+color3("FFFFFF")+color4(CL[randint(0,9)])
-
- if _i > 6 :
- _COLOR = color1("H029FF4")+color3("FFFFFF")+color4(CL[randint(0,9)])
-
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT/2,_BT+_SK+_KT),pos(_x,_y)+t(_COLOR)+_BL+fsc(80,80)+t(fsc(100,100)),_txt)
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts),pos(_x,_y)+_COLOR+_BL,_txt)
-
-
- ################退场方式#################
-
- out_EFT = move(_x, _y, _x + 60, _y) + _COLOR + fad(0, duration) +_BL
- ass_main(ASS_BUF, SubL(out_ts, out_te), out_EFT, _txt)
-
- ##################附加效果#################
- po_ts = in_te + _SK - _KT/2- 20 # 效果开始时间
- po_te = in_te + _SK + _KT/2 # 效果结束时间
- EFT1 = alpha1(170) + alpha3(170) + color1('FFFFFF') + bord(5) + blur(5) + t(0, 100, bord(3) + blur(3)) + fad(0, 200)
- EFT2 = alpha1(170) + alpha3(0) + color1('FFFFFF') + color3('FFFFFF') + bord(3) + blur(3) + t(0, 100, bord(1) + blur(1) + alpha3(70)) + fad(0, 200)
- num = 60 # 曲线上点的个数
-
- ##### point1 #####
- xs = _x + randint(-8*_a/3 , 8*_a/3 ) # 开始点
- ys = _y + randint(-2*_Fs , _Fs/2 )
- xc1 = xs + randint(-2*_a , 2*_a ) # 控制点1
- yc1 = ys + randint(-7*_Fs/6 , 7*_Fs/6 )
- xc2 = xc1 + randint(-4*_a/3 , 4*_a/3 ) # 控制点2
- yc2 = yc1 + randint(-_Fs , _Fs )
- xe = _x # 结束点
- ye = _y
- points = Bezier3(num, xs, ys, xe, ye, xc1, yc1, xc2, yc2) # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
- for i in range(num):
- POS = pos(points[i][0], points[i][1]) # 获取曲线上点坐标
- EFT = POS + EFT1 + color3(CL[_j%10])
- ass_main(ASS_BUF, SubL(po_ts+i , po_te +i, 10, Pix_Style), EFT, PixPt())
- EFT = POS + EFT2
- ass_main(ASS_BUF, SubL(po_ts+i , po_te +i, 10, Pix_Style), EFT, PixPt())
-
- ##### point1 #####
- if _KT > _n*8 :
- xs = _x + randint(-8*_a/3 , 8*_a/3 ) # 开始点
- ys = _y + randint(-2*_Fs , _Fs/2 )
- xc1 = xs + randint(-2*_a , 2*_a ) # 控制点1
- yc1 = ys + randint(-7*_Fs/6 , 7*_Fs/6 )
- xc2 = xc1 + randint(-4*_a/3 , 4*_a/3 ) # 控制点2
- yc2 = yc1 + randint(-_Fs , _Fs )
- xe = _x # 结束点
- ye = _y
- points = Bezier3(num, xs, ys, xe, ye, xc1, yc1, xc2, yc2) # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
- for i in range(num):
- POS = pos(points[i][0], points[i][1]) # 获取曲线上点坐标
- EFT = POS + EFT1 + color3(CL[_j%10])
- ass_main(ASS_BUF, SubL(po_ts , po_te +i, 10, Pix_Style), EFT, PixPt())
- EFT = POS + EFT2
- ass_main(ASS_BUF, SubL(po_ts , po_te +i, 10, Pix_Style), EFT, PixPt())
-
-
- elif _i ==15:
-
- #################进入方式#################
- in_EFT = an(2)+move(_x+_a, _y+_Fs*7/4,_x,_y+_Fs*7/4) + fad(duration, 0) + _BL
- ass_main(ASS_BUF, SubL(in_ts, in_te,5), in_EFT, _txt)
- #################退场方式#################
-
- out_EFT = an(2)+move(_x, _y+_Fs*7/4, _x -_a, _y+_Fs*7/4) +color3(CL[randint(0,9)])+color4(CL[randint(0,9)]) + fad(0, duration) +_BL
- ass_main(ASS_BUF, SubL(out_ts, out_te,5), out_EFT, _txt)
-
- #################表现效果#################
- ass_main(ASS_BUF, SubL(in_te,_BT+_SK,5),an(2)+pos(_x,_y+_Fs*7/4)+_BL,_txt)
-
- ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT/2,5),an(2)+pos(_x,_y+_Fs*7/4)+_BL+t(fsc(115,115)+color3("FFFFFF")+color4("FFFFFF")),_txt)
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT/2,_BT+_SK+_KT,5),an(2)+pos(_x,_y+_Fs*7/4)+_BL+fsc(115,115)+color3("FFFFFF")+color4("FFFFFF")+t(fsc(100,100)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])),_txt)
-
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,5),an(2)+pos(_x,_y+_Fs*7/4)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL,_txt)
-
-
-
-
-
- else :
-
- #################进入方式#################
-
- in_EFT = an(2)+move(_x+30, _y+_Fs/2-30,_x,_y+_Fs/2,5)+fsc(70,70)+frin(70)+t(fsc(100,100)+fr(0))+ fad(duration, 0) + _BL
- ass_main(ASS_BUF, SubL(in_ts, in_te,5), in_EFT, _txt)
- #################退场方式#################
-
- out_EFT = an(2)+move(_x, _y+_Fs/2, _x + 60, _y+_Fs/2,5) + color3(CL[randint(0,9)])+color4(CL[randint(0,9)]) + fad(0, duration) +_BL
- ass_main(ASS_BUF, SubL(out_ts, out_te,5), out_EFT, _txt)
- #################表现效果#################
- ass_main(ASS_BUF, SubL(in_te,_BT+_SK,5),an(2)+pos(_x,_y+_Fs/2)+_BL,_txt)
- ass_main(ASS_BUF, SubL(_BT+_SK,_BT+_SK+_KT/2,5),an(2)+pos(_x,_y+_Fs/2)+_BL+t(fscy(60)+color3("FFFFFF")+color4("FFFFFF")),_txt)
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT/2,_BT+_SK+_KT,5),an(2)+pos(_x,_y+_Fs/2)+_BL+fscy(60)+color3("FFFFFF")+color4("FFFFFF")+t(fscy(100)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])),_txt)
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT,out_ts,5),an(2)+pos(_x,_y+_Fs/2)+color3(CL[randint(0,9)])+color4(CL[randint(0,9)])+_BL,_txt)
-
-
- #################附加效果#################
-
- for i in range(10):
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT/2,_BT+_SK+4*_KT),move(_x+randint(-15,15),_y+randint(-15,15),_x+randint(-40,40),_y+randint(-40,40))+fad(10, duration)+color1("FFFFFF")+color3(CL[randint(0,9)])+bord(0.5)+shad(0)+blur(2)+fr(60)+t(fr(60)), shape[randint(0,1)])
-
-
-
- return (ASS_BUF, TCAS_BUF)
复制代码 http://pan.baidu.com/s/1sjk9TrZ |
-
1
查看全部评分
-
|