- UID
- 2443
- 积分
- 1311
- 帖子
- 78
- 主题
- 21
- 论坛币
- 909
- 威望
- 8
- EP值
- 449
- MP值
- 0
- 阅读权限
- 100
- 注册时间
- 2015-3-7
- 在线时间
- 121 小时
- 最后登录
- 2018-7-21
|
本帖最后由 面麻 于 2016-4-11 15:15 编辑
Problem: I tried to make pix of a line as a whole, but no words showed when previewing avs script.
Is it the reason that I made wrong with the usage of gloabl variable?
Or the misunderstanding of BigPix structure, especially the InitBigPix() function?
Codes listed below:- from tcaxPy import *
- def tcaxPy_Init():
- global font
- global font_out
- global font_size
- font_file = GetVal(val_FontFileName)
- face_id = GetVal(val_FaceID)
- font_size = GetVal(val_FontSize)
- spacing = GetVal(val_Spacing)
- space_scale = GetVal(val_SpaceScale)
- color = DecRGB(GetVal(val_1C))
- bord = GetVal(val_Bord)
- font = InitFont(font_file, face_id, font_size, spacing, space_scale, color, bord, 0)
- font_out = InitFont(font_file, face_id, font_size, spacing, space_scale, color, 3 * bord, 1)
- def tcaxPy_User():
- pass
- def tcaxPy_Fin():
- FinFont(font)
- FinFont(font_out)
- def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
- #ASS_BUF = [] # used for saving ASS FX lines
- TCAS_BUF = [] # used for saving TCAS FX raw data
- # an5 -> an7, TCAS uses an7
- ux = _x - int(_a / 2 + 0.5)
- uy = _y - int(font_size / 2 + 0.5)
- if _j == 0:
- global LINEPIX
- LINEPIX = InitBigPix()
- texture = ImagePix('x3.png')
- PIX = TextPix(font, _txt)
- PIX = PixTexture(PIX, texture)
- BORD = TextPix(font_out, _txt)
- BORD = PixColorRGB(BORD, 0xFF0000)
- BORD = PixBlur(BORD, 4)
- PIX = CombinePixs(BORD, PIX)
- BigPixAdd(LINEPIX, PIX, ux, uy, 0)
- if _j == _n - 1:
- ALINEPIX = ConvertBigPix(LINEPIX)
- #tcaxLog(ALINEPIX)
- ts = 10 * _start
- te = 10 * _end
- tcas_main(TCAS_BUF, ALINEPIX, ts, te, ux, uy, 0)
- return (None, TCAS_BUF)
复制代码 |
|