- UID
- 363
- 积分
- 2032
- 帖子
- 123
- 主题
- 18
- 论坛币
- 3812
- 威望
- 10
- EP值
- 1178
- MP值
- 0
- 阅读权限
- 80
- 注册时间
- 2012-3-21
- 在线时间
- 284 小时
- 最后登录
- 2017-1-31
|
本帖最后由 jijidata 于 2013-11-19 04:15 编辑
- from tcaxPy import *
- from s import *
- from gdiFont import * #加入GDIfont模块
- import math
- import random
- def tcaxPy_Init():
- global _FontFileName
- global _FaceID
- global _Fs
- global _TextWidth
- global _TextHeight
- global _TextLength
- global _TextAdvDiff
- global _ResolutionX
- global _FD
- global _TextInitX
- global _Ascender # 字体上行高度
- global _Descender # 字体下行高度 通常为负数
- global _H
- _H = GetVal(val_FontSize)
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- _Fs = GetVal(val_FontSize)
- _Ascender = GetVal(val_Ascender) #字体上行高度
- _TextHeight = GetVal(val_TextHeight)# 第i句卡拉OK歌词的j个字符的高度
- _TextWidth = GetVal(val_TextWidth)# 第i句卡拉OK歌词的j个字符的宽度
- _TextLength = GetVal(val_TextLength)# 第i句卡拉OK歌词的文字总长度
- _TextAdvDiff = GetVal(val_TextAdvanceDiff)# 从初始位置到第i句卡拉OK歌词的j个字符的水平步距
- _TextInitX = GetVal(val_TextInitX)
- _ResolutionX = GetVal(val_ResolutionX)
- _FD = 1000 / GetVal(val_FXFPS)
- global GdiFont #GDIfont
- GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False)
- global Font
- Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
- def frxyz():
- X1 = randint(-720,720)
- X2 = randint(-720,720)
- X3 = randint(-720,720)
- return frx(X1)+fry(X2)+frz(X3)
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
- ASS_BUF = [] # 用于保存ASS特效
- _7X = _X - int(_A / 2 + 0.5)
- _7Y = _Y - int(_H / 2 + 0.5)
-
- if _i == 0:
- ass_main(ASS_BUF,SubL(_BT+_j*5-_n*5,_BT+_SK,1),an(5)+b(1)+bord(0)+blur(0)+pos(_X,_Y)+alpha(255)+color1("000000")+t(0,5+_SK*1.28,alpha(0)) ,_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+30,1),an(5)+bord(0)+blur(1)+color1("000000")+fad(0,200)+pos(_X,_Y)+org(_ResolutionX*0.5,0)+t(frz(-5)) ,_TXT)#表现方式
- for j in range(5):
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+90,2),an(1)+blur(2)+move(_X-20,_Y,_X+randint(-600,0),_Y+randint(-50,50))+t(fsc(0,0))+t(frxyz())+color3("000000")+fad(0,300)+fsc(40,40),"{\p3}m 0 0 l 50 49 l 100 0 l 51 50 l 100 100 l 50 51 l 0 100 l 49 50 l 0 0 m 45 45")
- if _i == 1:
- ass_main(ASS_BUF,SubL(_BT+_j*5-_n*5,_BT+_SK,1),an(5)+bord(1)+b(1)+blur(4)+pos(_X,_Y)+alpha(255)+color3("D080C7")+t(0,5+_SK*1.28,alpha(0)) ,_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+30,1),an(5)+bord(1)+b(1)+blur(5)+color3("D080C7")+fad(0,200)+pos(_X,_Y)+org(_ResolutionX*0.5,0)+t(frz(-5)) ,_TXT)#表现方式
- for j in range(20):
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+90,2),an(1)+blur(4)+bord(1.5)+move(_X-20,_Y,_X+randint(-600,0),_Y+randint(-50,50))+t(fsc(0,0)+frxyz())+color3("D080C7")+fad(0,300),"{\p3}m 21 16 b 17 16 17 23 21 23 b 25 23 26 16 21 16 m 24 19 l 43 20 l 24 20 m 18 19 l 0 20 l 18 20 m 20 16 l 21 0 l 22 16 m 20 23 l 21 40 l 22 23")
- if _i == 2:
- ass_main(ASS_BUF,SubL(_BT+_j*5-_n*5,_BT+_SK,1),an(5)+bord(1.5)+b(1)+blur(4)+pos(_X,_Y)+alpha(255)+color3("A14840")+t(0,5+_SK*1.28,alpha(0)) ,_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+30,1),an(5)+bord(1.5)+b(1)+blur(5)+color3("A14840")+fad(0,200)+pos(_X,_Y)+org(_ResolutionX*0.5,0)+t(frz(-5)) ,_TXT)#表现方式
- for j in range(20):
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+90,2),an(1)+blur(1)+bord(1.5)+move(_X-20,_Y,_X+randint(-600,0),_Y+randint(-50,50))+t(fsc(0,0)+frxyz())+color3("5D4740")+fad(0,300),"{\p3}m 21 16 b 17 16 17 23 21 23 b 25 23 26 16 21 16 m 24 19 l 43 20 l 24 20 m 18 19 l 0 20 l 18 20 m 20 16 l 21 0 l 22 16 m 20 23 l 21 40 l 22 23")
- if _i == 3:
- ass_main(ASS_BUF,SubL(_BT+_j*5-_n*5,_BT+_SK,1),an(5)+bord(1)+b(1)+blur(4)+pos(_X,_Y)+alpha(255)+color3("A14840")+t(0,5+_SK*1.28,alpha(0)) ,_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+30,1),an(5)+bord(1.5)+b(1)+blur(5)+color3("A14840")+fad(0,200)+pos(_X,_Y)+org(_ResolutionX*0.5,0)+t(frz(-5)) ,_TXT)#表现方式
- for j in range(20):
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+90,2),an(1)+blur(4)+bord(1.5)+move(_X-20,_Y,_X+randint(-600,0),_Y+randint(-50,50))+t(fsc(0,0)+frxyz())+color3("76BDB2")+fad(0,300),"{\p3}m 21 16 b 17 16 17 23 21 23 b 25 23 26 16 21 16 m 24 19 l 43 20 l 24 20 m 18 19 l 0 20 l 18 20 m 20 16 l 21 0 l 22 16 m 20 23 l 21 40 l 22 23")
- if _i > 3 and _i < 8:
- ass_main(ASS_BUF,SubL(_BT+_j*15-_n*15,_BT+_SK,1),an(5)+bord(1.5)+b(1)+blur(3)+fax(-3)+fsc(10,30)+move(_X+20,_Y-60,_X,_Y,0,600)+color3("00FFFF")+t(0,600,fax(0)+fsc(100,100)) ,_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+20,1),an(5)+bord(1.5)+b(1)+blur(3)+color3("00FFFF")+pos(_X,_Y)+t(fsc(0,0)) ,_TXT)#表现方式
- points = gfGetPoints(GdiFont, _TXT) #GDIfont
- PIX = PixFromPoints(points) #GDIfont
-
- InitPosX = _X - int(_A / 2 + 0.5) + PIX[0][0] # 第一个像素的X轴坐标
- InitPosY = _Y - int(_Fs / 2 + 0.5) + PIX[0][1] # 第一个像素的Y轴坐标
- for h in range(PIX[1][1]): # 开始纵向扫描
- PosY = InitPosY + h # 当前像素Y轴坐标
- for w in range(PIX[1][0]): # 开始横向扫描
- PosX = InitPosX + w
- X = PosX-randint(-50,50)
- Y = PosY-randint(-50,50) # 当前像素X轴坐标
- idx = 4 * (h * PIX[1][0] + w) # 脚标
- PixR = PIX[2][idx + 0] # 当前像素的红色分量
- PixG = PIX[2][idx + 1] # 当前像素的绿色分量
- PixB = PIX[2][idx + 2] # 当前像素的蓝色分量
- PixA = PIX[2][idx + 3] # 当前像素的透明度
- if PixA != 0: # 如果当前像素不为透明则进行如下操作
- ass_main(ASS_BUF, SubL(_BT+_SK-10,_BT+_SK+_KT+randint(0,80),1, Pix_Style),an(7)+move(PosX,PosY,PosX-randint(-20,20),PosY+30+randint(-20,20))+fad(0,300+randint(-100,100))+alpha(255-PixA)+blur(1)+shad(0)+bord(0)+color1("00FFFF"), "{\p4}m 7 0 b 2 0 1 4 1 6 b 1 8 2 12 7 12 b 12 12 13 8 13 6 b 13 4 12 0 7 0 ")
-
- for j in range(math.ceil(_KT)):
- J = [math.ceil(_KT)]
- step1 = (_KT*10*(j-1)/(max(J)*10-1))
- XC1= _X+_A*(j+1)/max(J)-_A
- YC1= _Y+_Fs*(j-1)/max(J)*(-1)**_j*0.3
- XC2= _X-randint(90,160)
- YC2= _Y+randint(-40,40)
- CurveMove = move(XC1,YC1,XC2,YC2)
- ass_main(ASS_BUF,SubL(_BT+_SK+step1,_BT+_SK+_KT+step1+80,2),an(5)+blur(4)+bord(0.5)+vc1("00FFFF","00FFFF","FFFFFF","FFFFFF")+fad(0,300)+frxyz()+color3("00FFFF")+CurveMove,"{\p3}m 21 16 b 17 16 17 23 21 23 b 25 23 26 16 21 16 m 24 19 l 43 20 l 24 20 m 18 19 l 0 20 l 18 20 m 20 16 l 21 0 l 22 16 m 20 23 l 21 40 l 22 23")
- if _i > 7:
- va3 = "\\3va(&HAF&,&HAF&,&H00&,&H00&)"
- ass_main(ASS_BUF,SubL(_BT-80+_j*3,_BT+_SK,1),an(5)+bord(1.5)+b(1)+blur(6)+moves4(_X+randint(-50,-40),_Y+randint(-50,15),_X,_Y+randint(-75,75),_X+150,_Y++randint(-150,150),_X,_Y,0,400),_TXT)#入场效果
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT,1),an(5)+bord(1.5)+b(1)+pos(_X,_Y)+t(0,_KT*4,fr(randint(-4,4))+fsc(140,140)+color3("FFFFFF")+bord(5)+blur(8))+t(_KT*4,_KT*10,fr(0)+fsc(100,100)+va3+bord(2)+blur(5)) ,_TXT)
- for k in range (10):
- start = _BT+_SK-_KT
- end = start+70
- blink = alt(start,end, t = 30 , FX1 = alpha(255), FX2 = alpha(0), offset = 0, a1 = None,a2 = None)
- sx = randint(-50,50)
- sy = randint(-120,-70)
- sy2 = sy + randint(120,180)
- ass_main(ASS_BUF,SubL(start ,end,2),an(5)+blur(4)+bord(0.5)+shad(0)+fad(300,300)+frxyz()+color("FFFFFF")+color3("BCB4FB")+fsc(randint(120,170),randint(120,170))+move(_X+sx,_Y+sy,_X+sx,_Y+sy2)+blink,"{\p3}m 30 23 b 24 23 24 33 30 33 b 36 33 37 23 30 23 m 35 27 l 61 28 l 35 29 m 26 27 l 0 28 l 26 29 m 29 23 l 30 0 l 31 23 m 29 33 l 30 57 l 31 33")
- if _i == 13 and _j > 11:
- for j in range(20):
- ass_main(ASS_BUF,SubL(_BT+_SK+randint(-20,-10),_BT+_SK+_KT+randint(50,70),2),an(5)+blur(random.uniform(1, 4))+bord(random.uniform(0,1))+shad(0)+fs(0)+fad(300,300)+move(_X+randint(-10,10),_Y-randint(-10,10),_X+randint(-100,100),_Y+randint(-70,70))+t(fs(0)+frxyz())+color1("00FFFF")+color3("00FFFF"),"{\p2}m 21 -2 b 18 -1 13 7 14 7 l 14 5 b 12 8 12 14 12 14 l 14 16 l 12 15 b 11 20 14 23 14 23 l 12 22 b 12 23 14 25 15 25 l 14 25 b 15 26 16 27 16 27 b 17 28 19 33 20 36 l 21 36 b 20 34 18 30 17 26 b 19 25 20 22 22 20 l 20 20 l 22 18 l 21 18 b 23 15 23 13 23 10 l 22 8 l 23 8 b 24 8 23 4 23 3 l 21 4 l 22 1 l 21 -2 m 20 3 b 17 8 16 16 17 22 b 16 23 15 7 20 3")
-
-
- return (ASS_BUF, None)
复制代码 依旧是移植之前写的template模板,有少许修改,中间那部分的曲线有少许瑕疵,衔接不完美,于是想着由于tcax支持像素字就加了试试效果,看看能不能糊弄覆盖过去,嘛~也大概差不多,找机会会修复的..
预览:
http://pan.baidu.com/s/1y27Mq
|
-
1
查看全部评分
-
|