- UID
- 9
- 积分
- 4251
- 帖子
- 293
- 主题
- 40
- 论坛币
- 8462
- 威望
- 29
- EP值
- 1646
- MP值
- 8
- 阅读权限
- 100
- 注册时间
- 2011-8-3
- 在线时间
- 151 小时
- 最后登录
- 2022-8-8
|
本帖最后由 四月一日 君寻 于 2012-6-4 18:55 编辑
- from tcaxPy import *
- from gdiFont import * #加入GDIfont模块
- def tcaxPy_Init():
- global _FontFileName
- global _FaceID
- global _Fs
- global _TextWidth
- global _TextHeight
- global _TextLength
- global _TextAdvDiff
- global _ResolutionX
- global _OffsetX
- global _FD
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- _Fs = GetVal(val_FontSize)
- _TextHeight = GetVal(val_TextHeight)
- _TextWidth = GetVal(val_TextWidth)
- _TextLength = GetVal(val_TextLength)
- _TextAdvDiff = GetVal(val_TextAdvanceDiff)
- _ResolutionX = GetVal(val_ResolutionX)
- _OffsetX = GetVal(val_OffsetX)
- _FD = 1000 / GetVal(val_FXFPS)
- global GdiFont #GDIfont
-
- GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False) #GDIfont
-
- global Font
- Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
- def tcaxPy_Fin():
- gfFinFont(GdiFont) #GDIfont
-
- FinFont(Font)
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
- ASS_BUF = []
- if _i > -1 and _i < 2:
- ass_main(ASS_BUF, SubL(_BT,_BT+_SK-10),an(5)+pos(_x,_y)+fad(200,0)+bord(1.5)+blur(1.5)+color3('EC487C'), _txt)
- ass_main(ASS_BUF, SubL(_BT+_SK-10,_BT+_SK+_KT),an(5)+pos(_x,_y)+bord(1.5)+blur(1.5)+alpha1(255)+color3('EC487C')+t(0,100,color3('FFFFFF')+blur(4)+bord(4))+t(300,600,bord(1.5)+blur(1.5)), _txt)
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET),an(5)+pos(_x,_y)+fad(0,200)+bord(1.5)+blur(1.5)+alpha1(255)+color3('FFFFFF'), _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: # 如果当前像素不为透明则进行如下操作
- rnd = randint(-20,20)
- R = randint(0,50)
- C = randint(-100,100)
-
- ass_main(ASS_BUF, SubL(_BT+_SK-10,_BT+_SK+_KT+R,1, Pix_Style),an(7)+mov(PosX,PosY,PosX,PosY+30+rnd)+fad(0,300-C)+alpha(255-PixA)+blur(1.5)+shad(0)+bord(0)+color1("FFFFFF"), "{\p4}m -5 -15 l -15 0 l -6 7 l 9 12 l 5 4 l 13 -13 ")
-
- EFT1 = alpha1(0) + alpha3(100) + bord(6) + blur(7)
- num = 60
- points1 = Bezier1(num, _x-7, _y+200+randint(10,50), _x-7, _y)
- points2 = Bezier1(num, _x, _y+200+randint(10,50), _x, _y)
- #points1 = Bezier3(num, _x-200+randint(-100,100), _y+20+randint(10,50), _x, _y, _x-100, _y-20+randint(10,50), _x-50, _y+20+randint(10,50))
- for i in range(num):
- POS1 = pos(points1[i][0], points1[i][1])
- EFT1 = POS1 + EFT1 + color3('91CCFF') + an(7)
- ass_main(ASS_BUF, SubL(_BT+_SK-70+i*1, _BT+_SK-70+(i+1)*1, 1, Pix_Style), EFT1, "{\p1}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(num):
- if randint(0,num) == 0:
- ass_main(ASS_BUF, SubL(_BT+_SK-65+i*1, _BT+_SK-65+(i+1)*1+20,1), an(7)+blur(0.3)+bord(0.2)+color3("FFFFFF") +color1("FFFFFF")+ mov(points2[i][0]+randint(-5,5), points2[i][1]+randint(-5,5),points2[i][0]+randint(-15,15), points2[i][1]+20)+fad(0,300)+fsc(60,60), "{\p4}m -5 -15 l -15 0 l -6 7 l 9 12 l 5 4 l 13 -13 ")
-
- if _i > 1 and _i < 7:
-
- dx = _x - int(_a / 2 + 0.5)
- dy = _y - int(_Fs / 2 + 0.5)
-
- outline = TextOutlinePoints(Font, _txt, 1.0)
-
- num = len(outline)
- dur = 100
- for i in range(num):
- CIR=RandCir2(_x, _y, 30, 34)
- ts = _BT + dur * i / num
- te = _ET
- x = dx + outline[i][0]
- y = dy + outline[i][1]
- B = randint(-100,100)
-
- ass_main(ASS_BUF, SubL(ts-20, _BT+_SK, 1, Pix_Style), an(7)+pos(x, y) + alpha1(0) + alpha3(150) + bord(1.5) + shad(0) + color3('EC487C') + color1('EC487C') + fad(200, 0) + blur(1.5), PixPt())
- ass_main(ASS_BUF, SubL(_BT+_SK, _BT+_SK+_KT+20, 1, Pix_Style), an(7)+mov(x, y, CIR[0], CIR[1]) + alpha1(0) + alpha3(150) + bord(1.5) + shad(0) + color3('EC487C') + color1('ED00BA') + fad(0, 300) + blur(1.5), PixPt())
-
- #points = gfGetPoints(GdiFont, _txt) #GDIfont
- #PIX = PixFromPoints(points) #GDIfont
-
- PIX = TextPix(Font, _txt)
- 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: # 如果当前像素不为透明则进行如下操作
- rnd = randint(-30,30)
- R = randint(-100,100)
- H = randint(-10,10)
- ass_main(ASS_BUF, SubL(int(_BT+_SK+w*(_KT/PIX[1][0]))+H,int(_BT+_SK+150+rnd+w*(_KT/PIX[1][0])),1, Pix_Style),an(7)+mov(PosX,PosY,PosX-20+rnd,PosY)+fad(0,300+R+rnd)+alpha(255-PixA)+shad(0)+bord(1)+blur(1)+org(_x,_y)+color1("FFFFFF")+frx(0)+t(500,0,frx(360)+color3('FFA739')), "{\p5}m -5 -15 l -15 0 l -6 7 l 9 12 l 5 4 l 13 -13 ")
-
- ass_main(ASS_BUF, SubL(_BT,int(_BT+_SK+w*(_KT/PIX[1][0]))+H,1, Pix_Style),an(7)+pos(PosX,PosY)+shad(0)+bord(0)+alpha(255-PixA)+color1("FFFFFF")+fad(200,0), PixPt())
- if _i > 6:
- ass_main(ASS_BUF, SubL(_BT,_BT+_SK-10),an(5)+pos(_x,_y)+fad(200,0)+bord(1.5)+blur(1.5)+color3('EC487C'), _txt)
- ass_main(ASS_BUF, SubL(_BT+_SK-10,_BT+_SK+_KT),an(5)+pos(_x,_y)+bord(1.5)+blur(1.5)+alpha1(255)+color3('EC487C')+t(0,100,color3('FFFFFF')+blur(4)+bord(4))+t(300,600,bord(1.5)+blur(1.5)), _txt)
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT,_ET),an(5)+pos(_x,_y)+fad(0,200)+bord(1.5)+blur(1.5)+alpha1(255)+color3('FFFFFF'), _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: # 如果当前像素不为透明则进行如下操作
- rnd = randint(-20,20)
- R = randint(0,50)
- C = randint(-100,100)
-
- ass_main(ASS_BUF, SubL(_BT+_SK-10,_BT+_SK+_KT+R,1, Pix_Style),an(7)+mov(PosX,PosY,PosX,PosY+30+rnd)+fad(0,300-C)+alpha(255-PixA)+blur(1.5)+shad(0)+bord(0)+color1("FFFFFF"), "{\p4}m -5 -15 l -15 0 l -6 7 l 9 12 l 5 4 l 13 -13 ")
-
- EFT1 = alpha1(0) + alpha3(0) + color1('FFFFFF') + bord(1.5) + blur(2.5) + t(0, 100, fscx(1)+fscy(1)) + fad(0, 200)
- num = 100
-
- xs = _x + randint(-100, 100) # 开始点
- ys = _y + randint(-60, 20)
- xc1 = xs + randint(-50, 50) # 控制点1
- yc1 = ys + randint(-50, 50)
- xc2 = xc1 + randint(-40, 40) # 控制点2
- yc2 = yc1 + randint(-40, 40)
- xe = _x # 结束点
- ye = _y
-
- points1 = Bezier3(num, xs, ys, xe, ye, xc1, yc1, xc2, yc2) # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
- for i in range(num):
- POS1 = pos(points1[i][0], points1[i][1])
- EFT1 = POS1 + EFT1 + color3('FFA739') + an(7)
- ass_main(ASS_BUF, SubL(_BT+_SK-115+i*1, _BT+_SK-115+(i+1)*1+20, 1, Pix_Style), EFT1, "{\p2}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 ")
-
-
- return (ASS_BUF, None)
复制代码 懒得整理 或许里面有些东西写着了也没起作用……嘛还是习惯从头到尾一直写if…… 总之这货挺简单了 没啥特别的东西
感谢哔哔姐上传
下面是预览:
|
-
3
查看全部评分
-
|