- UID
- 9
- 积分
- 4251
- 帖子
- 293
- 主题
- 40
- 论坛币
- 8462
- 威望
- 29
- EP值
- 1646
- MP值
- 8
- 阅读权限
- 100
- 注册时间
- 2011-8-3
- 在线时间
- 151 小时
- 最后登录
- 2022-8-8
|
- from tcaxPy import *
- from pixLibs.ImageStone.pixStone import *
- def tcaxPy_Init():
- global _FD
- global _Fs
- global _TextLength
- global Font
- global FontOut
- global PIX_tex
- global PIX_tex2
- _FD = 1000 / GetVal(val_FXFPS)
- _Fs = GetVal(val_FontSize)
- _TextLength = GetVal(val_TextLength)
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- Font = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), MakeRGB(0, 0, 0), 0, 0)
- FontOut = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), MakeRGB(0, 0, 0), 3, 1)
- PIX_tex = ImagePix(abspath('ime06.png'), _Fs, 0)
- PIX_tex2 = ImagePix(abspath('out01.png'))
- def tcaxPy_Fin():
- FinFont(Font)
- FinFont(FontOut)
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
- ASS_BUF = [] # 保存ASS特效
- TCAS_BUF = [] # 保存TCAS特效
- ##### 主要特效编写操作 #####
-
-
- PIX_t = TextPix(Font, _txt) # 获取文字
-
- dx = _x - int(_a / 2 + 0.5) + PIX_t[0][0]
- dy = _y - int(_Fs / 2 + 0.5) + PIX_t[0][1]
- dur = _KT * 10
- PIX_t = PixTexture(PIX_t, PIX_tex) # 增加纹理
- PIX_out = TextPix(FontOut, _txt) # 获取边框
- PIX_out = PixTexture(PIX_out, PIX_tex2)
- PIX_out = PixColorMul(PIX_out, 1, 1, 1, 1) # 增加透明度
- PIX_out = PixBlur(PIX_out, 3) # 增加模糊
- PIX_ori = CombinePixs(PIX_out, PIX_t) # 混合文字主体和边框 (边框作底)
- points = PixPoints(PIX_ori)
- pt_num = len(points)
-
- for i in range(pt_num):
- w = points[i][0]
- h = points[i][1]
- idx = 4 * (h * PIX_ori[1][0] + w) # 脚标
- PixR = PIX_ori[2][idx + 0] # 当前像素的红色分量
- PixG = PIX_ori[2][idx + 1] # 当前像素的绿色分量
- PixB = PIX_ori[2][idx + 2] # 当前像素的蓝色分量
- PixA = PIX_ori[2][idx + 3] # 当前像素的透明度
-
- x = dx + points[i][0]
- y = dy + points[i][1]
-
- C = randint(-20, 20)
- EFT1 = shad(0)+bord(0)+pos(x,y)+alpha(255-PixA)+color1(FmtRGB(PixR,PixG,PixB))
- ass_main(ASS_BUF, SubL(_BT+C,_ET+C,1,Pix_Style), EFT1, PixPt())
-
-
- if _i > -1 and _i < 4:
- for i in range(_BT+_SK-20,_BT+_SK+_KT,30):
- for k in range(3):
- ass_main(ASS_BUF, SubL(i, i+150,1), blur(0.5)+color1('FFFFFF')+color3('FFFFFF')+bord(0.5)+fad(30,300)+t(frx(180+randint(0,360))+fry(150+randint(0,560)))+mov(_x+randint(30,60),_y-randint(20,50),_x-randint(30,60),_y+randint(20,50)), "{\p3}m -1 16 l 2 20 l 2 13 l 11 3 l 16 -2 b 26 -12 32 -8 23 21 l 18 18 l 21 23 b 17 28 11 35 5 39 l 0 36 l 3 40 b 0 44 -4 48 -8 50 l -13 44 l -11 50 l -14 53 l -17 50 l -17 53 l -20 50 l -24 53 l -24 51 b -30 54 -35 56 -41 56 l -41 52 b -36 52 -29 49 -25 46 l -27 43 l -23 43 l -24 39 l -21 42 l -21 34 l -17 30 l -16 37 l -15 28 ")
-
- dx = _x - int(_a / 2 + 0.5)
- dy = _y - int(_Fs / 2 + 0.5)
- if _i > 3:
- tshu = int(_KT/20)
- for i in range(tshu):
- ts = _BT + _SK + i*20
- te = ts
- for h in range(70):
- MOV = mov(dx+5+randint(0,_a),dy+5+randint(0,_Fs),_x+randint(-100,100),_y+randint(-100,100))
- EFT1 = alpha3(150)+bord(2)+blur(2)+frx(0)+fry(0)+t(fscx(1)+fscy(1)+frx(360)+fry(360))+fad(0, 200)
- EFT = MOV + EFT1
- ass_main(ASS_BUF, SubL(ts+h,te+h+80, 1), EFT, "{\p4}m -5 -15 l -15 0 l -6 7 l 9 12 l 5 4 l 13 -13 ")
-
- for b in range (_BT+_SK,_BT+_SK+_KT,15):
- ass_main(ASS_BUF, SubL(b,b+10,3), bord(0)+blur(6)+alpha1(0)+pos(_x+5,_y+4)+fs(40)+color1('FFFFFF'), _txt)
- ass_main(ASS_BUF, SubL(b,b+10,3), bord(0)+blur(4)+alpha1(0)+pos(_x+5,_y+4)+fs(35)+color1('FFFFFF'), _txt)
- return (ASS_BUF, TCAS_BUF)
复制代码 纹理的例子 |
-
1
查看全部评分
-
|