- UID
- 702
- 积分
- 1002
- 帖子
- 241
- 主题
- 12
- 论坛币
- 2292
- 威望
- 2
- EP值
- 520
- MP值
- 0
- 阅读权限
- 50
- 注册时间
- 2012-9-9
- 在线时间
- 281 小时
- 最后登录
- 2014-4-1
|
呜咕。。。比如de定义f的代码偶都不认识(T.T)。。。看了大大们的完整特效一个都无法看懂(T.T)。。
啊呜。。偶还是从基础学吧。。找一个M大大以前写的- 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), 1, 0)
- FontOut = InitFont(_FontFileName, _FaceID, _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale),
- MakeRGB(180, 180, 180), 5, 1)
- PIX_tex = ImagePix(abspath('tex2.png'), _Fs, 0)
- PIX_tex2 = ImagePix(abspath('tex5.png'))
- def tcaxPy_Fin():
- FinFont(Font)
- FinFont(FontOut)
- def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
- ASS_BUF = [] # 保存ASS特效
- TCAS_BUF = [] # 保存TCAS特效
- ##### 主要特效编写操作 #####
- dx = _x - int(_a / 2 + 0.5) # 一个固定操作, 将an5的坐标转换为an7
- dy = _y - int(_Fs / 2 + 0.5) # ASS特效默认采用an5坐标, TCAS特效则采用an7坐标
- if (_i == 12):
- dy += _Fs + 8
- ts_0 = _start - _FD * 10 / 10
- ts = _start
- te = _end
- te_0 = te + _FD * 5 / 10
- tm = _start + _elapk
- PIX_t = TextPix(Font, _txt) # 获取文字
- 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, 0.9) # 增加透明度
- PIX_out = PixBlur(PIX_out, 6) # 增加模糊
- PIX_ori = CombinePixs(PIX_out, PIX_t) # 混合文字主体和边框 (边框作底)
- center = _n / 2 - 0.5 # center index of 5 texts is 2, center index of 6 is 2.5
- x = dx + 50 * (_j - center) / center
- y = dy + 10
- for i in range(10):
- x = x + (dx - x) * (i + 1) / 5
- y = y + (dy - y) * (i + 1) / 5
- PIX = PixBlur(PIX_ori, 40 - i * 4)
- tcas_main(TCAS_BUF, PIX, 10 * ts_0 + _FD * i, 10 * ts_0 + _FD * (i + 1), x, y, 0)
- PIX = PIX_ori
- tcas_main(TCAS_BUF, PIX, 10 * ts, 10 * te, dx, dy, 0)
- for i in range(0, 10 * _k, int(2 * _FD)):
- PIX = PIX_ori
- PIX = PixBlur(PIX, 0)
- PIX = pstSoftGlow(PIX, 10, 60, 110)
- tcas_main(TCAS_BUF, PIX, 10 * tm + i, 10 * tm + i + _FD, dx, dy, 0) # PixBlur(PIX, 0) 有特殊效
- 果
- for i in range(5):
- PIX = PixBlur(PIX_ori, (i + 1) * 4)
- #PIX = PixColorMul(PIX, 1, 1, 1, 0.5 + 0.5 * (5 - i - 1) / 5)
- tcas_main(TCAS_BUF, PIX, 10 * te_0 - _FD * (5 - i), 10 * te_0 - _FD * (5 - i - 1), dx, dy, 0)
- # ASS
- if IsLineChanged(_i):
- num = int(_TextLength[_i] / 2)
- points = Bezier1(num, dx, 10, dx + _TextLength[_i], 10)
- for i in range(num):
- ass_main(ASS_BUF, SubL(_start + i / 5, _start + i / 5 + 80, 0, Pix_Style), \
- pos(points[i][0], points[i][1]) + alpha1(HexToDec('77')) + alpha3(HexToDec('F4')) + bord(1)
- + blur(1) + color3('A54AFF') + color1('A54AFF') + \
- t(0, 200, bord(6) + blur(6)) + t(600, 800, bord(1) + blur(1)), PixPt())
- ass_main(ASS_BUF, SubL(_start + i / 5, _start + i / 5 + 80, 1, Pix_Style), \
- pos(points[i][0], points[i][1]) + alpha1(HexToDec('77')) + alpha3(HexToDec('AA')) + bord(1)
- + blur(1) + color3('A54AFF') + color1('A54AFF') + \
- t(0, 100, bord(1.8) + blur(1.8)) + t(100, 200, bord(2.3) + blur(2.3)) +\
- t(200, 600, bord(1.8) + blur(1.8)) + t(600, 800, bord(1) + blur(1)), PixPt())
- ass_main(ASS_BUF, SubL(_start + i / 5, _start + i / 5 + 80, 2, Pix_Style), \
- pos(points[i][0], points[i][1]) + alpha1(HexToDec('77')) + alpha3(HexToDec('AA')) + bord
- (0.7) + blur(0.7) + color3('FFFFFF') + color1('FFFFFF') + \
- t(0, 100, bord(1.6) + blur(1.6)) + t(100, 200, bord(2.1) + blur(2.1)) +\
- t(200, 600, bord(1.6) + blur(1.6)) + t(600, 800, bord(0.8) + blur(0.8) + alpha3(255)), PixPt
- ())
- points = Bezier1(num, dx + _TextLength[_i], dy + _Fs + 10, dx, dy + _Fs + 10)
- for i in range(num):
- ass_main(ASS_BUF, SubL(_start + i / 5, _start + i / 5 + 80, 0, Pix_Style), \
- pos(points[i][0], points[i][1]) + alpha1(HexToDec('77')) + alpha3(HexToDec('F4')) + bord(1)
- + blur(1) + color3('A54AFF') + color1('A54AFF') + \
- t(0, 200, bord(6) + blur(6)) + t(600, 800, bord(1) + blur(1)), PixPt())
- ass_main(ASS_BUF, SubL(_start + i / 5, _start + i / 5 + 80, 1, Pix_Style), \
- pos(points[i][0], points[i][1]) + alpha1(HexToDec('77')) + alpha3(HexToDec('AA')) + bord(1)
- + blur(1) + color3('A54AFF') + color1('A54AFF') + \
- t(0, 100, bord(1.8) + blur(1.8)) + t(100, 200, bord(2.3) + blur(2.3)) +\
- t(200, 600, bord(1.8) + blur(1.8)) + t(600, 800, bord(1) + blur(1)), PixPt())
- ass_main(ASS_BUF, SubL(_start + i / 5, _start + i / 5 + 80, 2, Pix_Style), \
- pos(points[i][0], points[i][1]) + alpha1(HexToDec('77')) + alpha3(HexToDec('AA')) + bord
- (0.7) + blur(0.7) + color3('FFFFFF') + color1('FFFFFF') + \
- t(0, 100, bord(1.6) + blur(1.6)) + t(100, 200, bord(2.1) + blur(2.1)) +\
- t(200, 600, bord(1.6) + blur(1.6)) + t(600, 800, bord(0.8) + blur(0.8) + alpha3(255)), PixPt
- ())
- ##### 将结果返回给tcax进行处理 #####
- return (ASS_BUF, TCAS_BUF)
复制代码 呜咕。。。从开始的MakeRGB的定义开始下面的就几乎不会了呢(T.T)。。PIX只知道用粒子特效的。。。用法一点都不知道
啊呜。。。能帮偶详细的讲解一下么0.0【貌似请求过分了呢(T.T)】。。 |
|