| 預覽:http://pan.baidu.com/s/1hqqY9CC#dir/path=%2FSaiyakuFX_Preview 复制代码from util.gdiFont import *
from tcaxPy import *
from s import *
def tcaxPy_Init():
    global _FontFileName
    global _FaceID
    global _Fs
    global _Height
    global Font
    global GdiFont
    _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)
    GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False)  
def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
    ASS_BUF = []
    dx1 = _X - int(_A / 2 + 0.5)   
    dy1 = _Y - int(_Fs / 2 + 0.5)  
    outline = gfGetOutline(GdiFont, _TXT, dx1, dy1)
    C = ["D06F02","3E4D62","2B21DF","A85EAD","B25C95","408000","EA00EA"]
    c = [0,5,1,4,2,3,6,6,0,2,2,0]     # 每行的顏色
    ts = _BT + _SK-55
    
   #底色
    ass_main(ASS_BUF, SubL(ts+30, _ET+20+_j*5,10), an(7) + pos(0, 0) +fad(500,500) +p(4)+color1(C[c[_i]]),outline )
    #入場
    n = 4
    angle = randint(0,360)
    oo = (-7,-3,-7,-3,-2,-8,-2,-8,3,-7,3,-7,8,-2,8,-2,8,2,8,2,2,8,2,8,-2,8,-2,8,-7,3,-7,3)
    for tt in range(ts,ts+50,4):
        te = tt+4
        if ts+50-tt<4:
            te = ts+50
        pp = pp_rand(10,3,oo)
        oo = pp[1]
        ass_main(ASS_BUF, SubL(tt, te,20), an(7) + pos(_X, _Y)+color1("FFFFFF")+blur(2)+alpha(255-255*(tt-ts)/50)+fsc(110*(tt-ts)/50,110*(tt-ts)/50)+frz(angle) + clip2(4, outline)+p(1), pp[0])
    #存在
    oo = (-7,-3,-7,-3,-2,-8,-2,-8,3,-7,3,-7,8,-2,8,-2,8,2,8,2,2,8,2,8,-2,8,-2,8,-7,3,-7,3)
    for tt in range(ts+50,_ET+_j*5,n):
        pp = pp_rand(randint(0,3),randint(0,3),oo)
        oo = pp[1]
        ass_main(ASS_BUF, SubL(tt, tt+n,20), an(7) +blur(2)+ pos(_X, _Y)+color1("FFFFFF")+fsc(110,110)+frz(angle) + clip2(4, outline)+p(1), pp[0])
        angle -= 4
    #出場
    oo = (-7,-3,-7,-3,-2,-8,-2,-8,3,-7,3,-7,8,-2,8,-2,8,2,8,2,2,8,2,8,-2,8,-2,8,-7,3,-7,3)
    for tt in range(_ET+_j*5,_ET+50+_j*5,4):
        pp = pp_rand(10,3,oo)
        oo = pp[1]
        ass_main(ASS_BUF, SubL(tt, tt+4,20), an(7) +blur(2)+ pos(_X, _Y)+color1("FFFFFF")+alpha(255*(tt-_ET)/50)+fsc(110-110*(tt-_ET)/50,130-130*(tt-_ET)/50)+frz(angle) + clip2(4, outline)+p(1), pp[0])
    #星星擴散
    if _i > 5:    
        ts = _BT + _SK-40
        te = _BT + _SK + _KT-20
        count = int((te - ts)/2 )
        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(count):
            pt = points[randint(0, pt_num - 1)]
            t0 = randint(int(ts), int(te))
            t1 = t0 + 150
            x = dx + pt[0]
            y = dy + pt[1]
            EFT = move(x, y, randint(x - 50, x + 50), randint(y - 35, y + 35)) + fad(0, 300) + alpha1(0) + color1('FFFFFF') + \
                  alpha3(0) + color3(C[c[randint(0,6)]]) + bord(0.5) + blur(1)+t(fry(360*3)) 
            ass_main(ASS_BUF, SubL(t0, t1, 2, Pix_Style), EFT, RandPolygon(13/8, 13/8, 4))
    return (ASS_BUF, None)
#腦殘隨機圖形
def pp_rand(n,m,oo):     
    
    x11 = oo[0] + randint(-n,n)
    y11 = oo[1] + randint(-m,m)
    x12 = oo[2] + randint(-n,n)
    y12 = oo[3] + randint(-m,m)
    x21 = oo[4] + randint(-n,n)
    y21 = oo[5] + randint(-m,m)
    x22 = oo[6] + randint(-n,n)
    y22 = oo[7] + randint(-m,m)
    x31 = oo[8] + randint(-n,n)
    y31 = oo[9] + randint(-m,m)
    x32 = oo[10] + randint(-n,n)
    y32 = oo[11] + randint(-m,m)
    x41 = oo[12] + randint(-n,n)
    y41 = oo[13] + randint(-m,m)
    x42 = oo[14] + randint(-n,n)
    y42 = oo[15] + randint(-m,m)
    x51 = oo[16] + randint(-n,n)
    y51 = oo[17] + randint(-m,m)
    x52 = oo[18] + randint(-n,n)
    y52 = oo[19] + randint(-m,m)
    x61 = oo[20] + randint(-n,n)
    y61 = oo[21] + randint(-m,m)
    x62 = oo[22] + randint(-n,n)
    y62 = oo[23] + randint(-m,m)
    x71 = oo[24] + randint(-n,n)
    y71 = oo[25] + randint(-m,m)
    x72 = oo[26] + randint(-n,n)
    y72 = oo[27] + randint(-m,m)
    x81 = oo[28] + randint(-n,n)
    y81 = oo[29] + randint(-m,m)
    x82 = oo[30] + randint(-n,n)
    y82 = oo[31] + randint(-m,m)
    pp = "m -10 0 b {0} {1} {2} {3} -5 -5 b {4} {5} {6} {7} 0 -10 b {8} {9} {10} {11} 5 -5 b {12} {13} {14} {15} 10 0 b {16} {17} {18} {19} 5 5 b {20} {21} {22} {23} 0 10 b {24} {25} {26} {27} -5 5 b {28} {29} {30} {31} -10 0 ".format(x11,y11,x12,y12,x21,y21,x22,y22,x31,y31,x32,y32,x41,y41,x42,y42,x51,y51,x52,y52,x61,y61,x62,y62,x71,y71,x72,y72,x81,y81,x82,y82)
    return [pp,(x11,y11,x12,y12,x21,y21,x22,y22,x31,y31,x32,y32,x41,y41,x42,y42,x51,y51,x52,y52,x61,y61,x62,y62,x71,y71,x72,y72,x81,y81,x82,y82)]
 |