- UID
- 285
- 积分
- 1963
- 帖子
- 188
- 主题
- 10
- 论坛币
- 4570
- 威望
- 7
- EP值
- 1037
- MP值
- 38
- 阅读权限
- 50
- 注册时间
- 2012-1-23
- 在线时间
- 517 小时
- 最后登录
- 2018-9-6
|
- from tcaxPy import *
- def RandCir(a, b, r1, r2, n):
- R = randint(r1, r2)
- x = AdvInt(R * cos(n) + a)
- y = AdvInt(R * sin(n) + b)
- return (x, y)
- def jiz(x):
- if x%2==0:
- return 1
- else:
- return 0
- def tcaxPy_Init():
- global _FontFileName
- global _FaceID
- global _Fs
- global _Height
- global Font
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- _Fs = GetVal(val_FontSize)
- _Height = GetVal(val_TextHeight)
- Font = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)
-
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _x, _y, _a, _txt):
- ASS_BUF = []
- dx = _x - int(_a / 2 + 0.5)
- dy = _y - int(_Fs / 2 + 0.5)
- if _i > 9 or _i < 9 :
- for i in range (20):
- ass_main(ASS_BUF, SubL(_BT+_SK+_KT/50*i,_BT+_SK+_KT+5,20-i+1),pos(_x,_y)+fad(0,50)+color3("FFFFFF")+be(6/15*i)+alpha1(15*i)+alpha3(12*i)+color1("E9CD75")+fs(_Fs-10+i*1.5)+t(_KT*3,_KT*10-_KT/5*i+50,alpha1(256)+alpha3(256)+fs(_Fs)), _txt)
- ass_main(ASS_BUF, SubL(_BT+_j*6,_ET+_j*6,1),an(5)+pos(_x,_y)+fad(250,200)+be(6), _txt)
- if _i == 0 :
- for i in range(int(randint(1,2))):
- T=randint(130,150)
- Tz=randint(15,25)
- xs=_x-_a/2+_a/2*i
- ys=_y+_Fs/2+15
- xe=xs+_a+randint(-7,10)
- ye=ys-(xe-xs)*1.73
- tk= int(T/Tz)
- eft= ''.join(t(0+k*Tz*10,(k+1)*Tz*10,fscx(100-jiz(k)*80)) for k in range(tk))
-
- ass_main(ASS_BUF,SubL(_BT-25+_SK+i*randint(25,45),_BT+_SK+T-25+i*35),move(xs,ys,xe,ye)+bord(0)+frz(-30)+fad(55,200)+eft,"{\p2}m 22 13 b 22 14 21 14 21 15 b 19 10 15 7 12 4 b 9 2 5 0 3 0 b 0 0 -1 0 0 2 b 1 4 4 7 4 9 b 6 11 7 12 8 15 b 9 18 11 17 13 17 b 11 18 10 19 10 20 b 10 21 13 21 10 22 b 10 23 8 25 11 25 b 9 26 9 28 10 28 b 11 30 9 33 8 35 b 7 36 7 38 7 39 b 9 38 9 37 9 36 b 10 35 10 32 12 32 b 13 33 13 31 14 31 b 14 32 16 32 15 30 b 18 30 18 27 18 26 b 18 23 21 20 21 17 b 22 18 21 19 21 21 b 21 22 21 23 22 23 m 22 13 b 22 14 23 14 23 15 b 25 11 27 8 31 5 b 35 2 37 1 39 0 b 45 -1 44 1 43 3 b 41 5 40 8 38 10 b 37 12 37 13 36 15 b 36 17 33 17 31 17 b 33 18 33 18 34 19 b 36 22 34 21 34 22 b 36 24 35 24 34 24 b 35 26 36 28 34 28 b 34 31 36 34 37 35 b 38 36 38 38 37 38 b 36 38 35 36 35 35 b 35 34 34 32 33 32 b 32 32 31 33 31 31 b 30 32 29 31 29 30 b 27 30 27 28 26 25 b 26 23 23 20 23 17 b 22 18 23 20 23 21 b 23 23 22 23 22 23{\p0}")
-
- if _i == 11 :
- num = 80 # 曲线上点的个数
- xs = _x + randint(-70, 70) # 开始点
- ys = _y + randint(-20, 60)
- xc1 = _x + randint(-80, 80) # 控制点1
- yc1 = _y + randint(-50, 60)
- xc2 = _x + randint(-120, 160) # 控制点2
- yc2 = _y + randint(-80, 90)
- 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+color3('FFFFFF')+color1('FFFFFF')+bord(0.5)+blur(1)+t(fs(0)) + fad(0, 200)
- ass_main(ASS_BUF, SubL(_BT+_SK-_KT/2+_KT/2/80*i, _BT+_SK-_KT/2+_KT/2/80*i+45,0), EFT, PixPt())
- for i in range(5):
- ass_main(ASS_BUF, SubL(_BT+_SK-5, _BT+_SK+100,0), move(_x,_y,_x+randint(-50,50),_y+randint(-50,20))+fad(150,300)+color3('FFFFFF')+bord(0)+fsc(1000,1000)+t(frz(randint(-60,60)))+fscy(150), "{\p4}m 0 0 l 0 -13 l 1 0 l 14 -7 l 2 1 l 14 7 l 1 2 l 1 15 l 0 2 l -13 7 l -1 1 l -13 -7 ")
- if _i > 1 and _i < 6 :
- nk1 = (0,1,2,3)
- n = nk1[randint(0,3)]*90+randint(40,50)
- nk = (-1,0,1)
- n2 = n-180*nk[randint(0,1)]+randint(-15,15)
- zj = RandCir(_x,_y,25,35,n)
- zj2 = RandCir(_x,_y,65,75,n2)
- num = 80 # 曲线上点的个数
- x1 = randint(30,40)
- x2 = randint(-40,-30)
- xc = [x1,x2] # 控制点1
- yc = xc[randint(0,1)]
- xs = _x +yc
- ys = _y + yc # 开始点
- xc1 = _x + randint(-60,60) # 控制点2
- yc1 = _y + randint(-60,60)
- xe = _x # 结束点
- ye = _y
- points = Bezier2(num, zj[0], zj[1], xe, ye, zj2[0], zj2[1]) # 3阶贝塞尔曲线, 控制点的生成是重点以及难点
- for i in range(num):
- POS = pos(points[i][0], points[i][1]) # 获取曲线上点坐标
- EFT = POS+color3('FFFFFF')+color1('FFFFFF')+bord(1)+t(fs(0)+bord(0)) + fad(0, 200)
- ass_main(ASS_BUF, SubL(_BT+_SK-100+i/60*80, _BT+_SK-100+i/60*80+60,0), EFT, PixPt())
- for i in range(5):
- ass_main(ASS_BUF, SubL(_BT+_SK-5, _BT+_SK+100,0), move(_x,_y,_x+randint(-50,50),_y+randint(-50,20))+fad(150,300)+color3('FFFFFF')+bord(0)+fsc(1000,1000)+t(frz(randint(-60,60)))+fscy(150), "{\p4}m 0 0 l 0 -13 l 1 0 l 14 -7 l 2 1 l 14 7 l 1 2 l 1 15 l 0 2 l -13 7 l -1 1 l -13 -7 ")
- if _i== 6 :
- PIX = TextPix(Font, _txt)
- points = PixPoints(PIX)
- pt_num = len(points)
- dx = _x - int(_a / 2 + 0.5) + PIX[0][0]
- dy = _y - int(_Fs / 2 + 0.5) + PIX[0][1]
- for i in range(0,pt_num,randint(3,5)):
- ag = (dy + points[i][1] - _y) / GetVal(val_TextHeight)[_i][_j] * 0.25
- iag = int(ag / pi / 2 * 360)
- EFT = pos(dx + points[i][0], dy + points[i][1])+fscx(0)+t(0,_KT*10+100,fscx(90))+t(_KT*10,(_ET+6*_j-10-_n*2-_BT-_SK)*10,fscx(0))+ frz(20)+t(frz(40))+t(fry(30)) + fad(100, 400) + alpha1(120) + color1('FFFFFF') + be(3)
- ass_main(ASS_BUF, SubL(_BT+_SK, _ET+6*_j-_n, 10, Pix_Style), EFT, "{\p1}m 0 0 l -40 0 0 1")
- if _i == 7 or _i == 10 or _i == 8 :
- for i in range(1):
- for k in range(5):
- x = _x+randint(-100,20)
- y = _y+randint(-20,60)
- jd = randint(-360,360)
- tk = randint(0,_KT)
- ass_main(ASS_BUF,SubL(_BT+_SK+tk,_BT+_SK+_KT+100,0),fad(200,400)+move(_x + int(_a / 2 + 0.5),_y - int(_Fs / 2 + 0.5),x,y)+color3('C8EF94')+fsc(150,150)+t(fr(jd))+bord(0)+t(color1("FFFFFF")),"{\p4}m 0 0 l 50 49 100 0 51 50 100 100 50 51 0 100 49 50 0 0 m 45 45 s 55 45 55 55 45 55 c ")
- ass_main(ASS_BUF,SubL(_BT+_SK+tk,_BT+_SK+_KT+100,1),fad(200,400)+move(_x + int(_a / 2 + 0.5),_y - int(_Fs / 2 + 0.5),x,y)+color3('C8EF94')+fsc(4,4)+blur(randint(2,5))+t(fr(jd))+bord(3)+t(color1("FFFFFF")),"●")
- if _i == 12 :
- if _j == 0 :
- _TextLength = GetVal(val_TextLength)
- for i in range(_n*14) :
- st = randint(0,_ET-_BT-20)
- ass_main(ASS_BUF,SubL(_BT-10+st,_BT-10+st+randint(80,150),0),fad(100,300)+pos(_x-_a/2+randint(0,_TextLength[_i]/3)*3,_y+randint(-16,22))+color3("FFFFFF")+alpha1(randint(100,256))+t(blur(randint(2,4))),"{\p2}m -6 -10 l 6 -10 l 12 0 l 6 10 l -6 10 l -12 0 l -6 -10 ")
- if _i == 9 :
- col = ("DBFCCF", "FEFCF8", "685131")
- PIX = TextPix(Font, _txt)
- n = len(PIX)
- l = randint(0,n+1)
- for i in range(40):
- PIX = TextPix(Font, _txt)
- points = PixPoints(PIX)
- n = len(points)
- pt = points[randint(0, n - 1)]
- x = dx+pt[0]+randint(-4,5)
- y = dy+pt[1]+randint(-4,5)
- tp = ("{\p3}m 0 0 l0 20 0 l 10 20 {\p0}","{\p3}m 0 0 l 0 14 0 l -14 -14 {\p0}","{\p4}m 0 0 l 0 21 l 14 7 l 21 -14 l 0 0 {\p0}","{\p3}m -10 0 l -10 -18 l 12 10 l -10 10 {\p0}")
- tp1 = tp[randint(0,3)]
- Xx = -50+randint(-50,50)
- Yy = randint(-30,30)
- R = randint(-30,10)
- MOVE = move(x,y,_x+Xx,_y+Yy)
-
- EFT = t(0,(_SK+_KT+90)*10,0.4,MOVE)+fad(0,500)+color1("EAF9DF")+be(3)+alpha3(randint(120,200))+color3("68A47C")+bord(2)+t(0,randint(0,_KT+50)*10,color1("685131")+bord(0))+fr(randint(-180,180))+t(fr(randint(-90,90)))
-
- ass_main(ASS_BUF,SubL(_BT+_SK,_BT+_SK+_KT+90), EFT, tp1)
- ass_main(ASS_BUF, SubL(_BT+_j*7,_BT+_SK+9,1),an(5)+pos(_x,_y)+fad(250,100)+be(6)+t(_SK-100-_j*70,(_SK)*10-_j*70,color1("FEFCF8")+color3("516C35")), _txt)
- return (ASS_BUF, None)
复制代码 第一句蝴蝶的时间没调好,看着不明显。感谢河神关于贝塞尔曲线的教导 。预览扔度娘盘了.......
视频预览
|
-
1
查看全部评分
-
|