- UID
- 3
- 积分
- 8169
- 帖子
- 259
- 主题
- 68
- 论坛币
- 5016
- 威望
- 54
- EP值
- 2533
- MP值
- 20
- 阅读权限
- 200
- 注册时间
- 2011-8-3
- 在线时间
- 1097 小时
- 最后登录
- 2022-10-8
|
預覽:http://pan.baidu.com/s/1hqqY9CC#dir/path=%2FSaiyakuFX_Preview- from tcaxPy import *
- from util.cairo import *
- from util.gdiFont import *
- def tcaxPy_Init():
- global _Fs
- global _FD # 一帧的持续时间, 约40毫秒
- global _Spacing # 字体间距
- global Font # 首要字体
- global GdiFont
- global _TextWidth # 文字宽度
- global _TextHeight # 文字高度
- global _TextLength
- global _TextAdvDiff
- global _ResolutionX
- global _OffsetX
- _TextHeight = GetVal(val_TextHeight)
- _TextWidth = GetVal(val_TextWidth)
- _TextLength = GetVal(val_TextLength)
- _TextAdvDiff = GetVal(val_TextAdvanceDiff)
- _ResolutionX = GetVal(val_ResolutionX)
- _OffsetX = GetVal(val_OffsetX)
- _Fs = GetVal(val_FontSize)
- _FD = 1000 / GetVal(val_FXFPS)
- _FontFileName = GetVal(val_FontFileName)
- _FaceID = GetVal(val_FaceID)
- _Spacing = GetVal(val_Spacing)
- Font = InitFont(_FontFileName, _FaceID, _Fs, _Spacing, GetVal(val_SpaceScale), MakeRGB(255, 255, 255), 0, False)
- GdiFont = gfInitFont(GetVal(val_FontFaceName), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0, False) #GDIfont
-
- # cairo
- global ctx
- fx_width = GetVal(val_ResolutionX)
- fx_height = GetVal(val_ResolutionY)
- surface = ImageSurface(FORMAT_ARGB32, fx_width, fx_height)
- ctx = Context(surface)
- def tcaxPy_Fin():
- FinFont(Font)
- gfFinFont(GdiFont) #GDIfont
- def tcaxPy_Main(_i, _j, _n, _BT, _ET, _SK, _KT, _X, _Y, _A, _TXT):
- ASS_BUF = [] # 保存ASS特效
- TCAS_BUF = [] # 保存TCAS特效
- global COLOR
- global COLOR_PRE
- if _j==0:
- COLOR = ["1BE61A","CBC826","C90075","CC7114","181AC0","17E3BD","1274C8","A25AC9"][randint(0,7)]
- COLOR_PRE = COLOR
- else:
- while COLOR==COLOR_PRE:
- COLOR = ["1BE61A","CBC826","C90075","CC7114","181AC0","17E3BD","1274C8","A25AC9"][randint(0,7)]
- COLOR_PRE = COLOR
- if _i > -1:
- dx = _X - int(_A / 2 + 0.5)
- dy = _Y - int(_Fs / 2 + 0.5)
- T_EFT = 30
- frames = int((T_EFT+2)*10 / _FD + 0.5)
- rand = randint(3,6)
- outline2 = gfGetOutline(GdiFont, _TXT, dx,dy)
- for i in range(frames):
- ts = _BT+_SK+5-T_EFT + i * _FD / 10
- te = _BT+_SK+5-T_EFT + (i + 1) * _FD / 10
- frame_pct = i / frames
- outline = gfGetOutline(GdiFont, _TXT, 0, 0)
- AssDraw(ctx, outline)
- path_trans(ctx, paint_filter, (dx, dx, rand, _Fs, frame_pct))
- text = ToAssDraw(ctx)
- EFT = an(7) + pos(dx,dy)+color1(COLOR)+shad(0) + p(4)
- ass_main(ASS_BUF, SubL(ts, te,20), EFT+blur(1.5)+alpha(100), text)
- ass_main(ASS_BUF, SubL(te, _ET+_j*5,1), EFT+alpha(180)+blur(1.5), text)
- ass_main(ASS_BUF, SubL(te, _ET+_j*5,20), EFT+alpha(230)+blur(5)+clip(4, outline2), text)
- outline = gfGetOutline(GdiFont, _TXT, 0, 0)
- ass_main(ASS_BUF, SubL(_BT+_j*5, _ET+_j*5,2),an(7)+ pos(dx,dy)+fad(0,150)+shad(1.5)+p(4), outline)
- return (ASS_BUF,None)
- def paint_filter(x, y, param):
-
- char_left, line_left, line_width, line_height, frame_pct = param
-
- char_x = ceil(x + char_left * 8 - line_left * 8)
-
- max_diff_x = cos(y / line_height * pi / 10 - frame_pct * pi * 5) * 20 * 8
-
- max_diff_y = cos(char_x / line_width * pi / 10 - frame_pct * pi * 5) * 20 * 8
-
- new_x = char_x - floor(max_diff_y * frame_pct)
-
- new_y = y + floor(max_diff_y * frame_pct)
-
- return new_x, new_y
复制代码 |
-
1
查看全部评分
-
|