- UID
- 2443
- 积分
- 1311
- 帖子
- 78
- 主题
- 21
- 论坛币
- 909
- 威望
- 8
- EP值
- 449
- MP值
- 0
- 阅读权限
- 100
- 注册时间
- 2015-3-7
- 在线时间
- 121 小时
- 最后登录
- 2018-7-21
|
Right as what the title shows, I found the differences of position setting behaviors between PixPos() and tcas_main() function.
We could found the original codes of PixPos() function at tcaxPy.py, which has been listed below:- def PixPos(PIX, x, y):
- return ((x, y), PIX[1], PIX[2])
复制代码 It returns a PIX structure with a change of position info only.
About tcas_main() function, I could merely provide its parameter info by its definition:- def tcas_main(TCAS_BUF, pix, start, end, offsetX, offsetY, layer):
复制代码 offsetX and offsetY stand for the offsets in the horizontal and vertical direction respectively.
At first, I estimated that their effects would be the same, but a different result is showed by the preview.
The test script is (Note: When using PixPos() function, we must set offsetX and offsetY as 0 in tcas_main()):- 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)
- font = InitFont(font_file, face_id, font_size, spacing, space_scale, 0xFFFFFF, 0, 0)
- font_out = InitFont(font_file, face_id, font_size, spacing, space_scale, 0xFF0000, 2, 1)
- def tcaxPy_Fin():
- FinFont(font)
- FinFont(font_out)
- def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):
- 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)
- text = TextPix(font, _txt)
- bord = TextPix(font_out, _txt)
- bord = PixBlur(bord, 2)
- main = CombinePixs(bord, text)
- #main = PixPos(main, ux, uy)
- ts = 10 * _start
- te = 10 * _end
- tcas_main(TCAS_BUF, main, ts, te, ux, uy, 0)
- #tcas_main(TCAS_BUF, main, ts, te, 0, 0, 0)
- return (None, TCAS_BUF)
复制代码 We could find the difference clearly from the samples below:
pixpos():
tcas_main():
I prefer the effect of position setting behavior by tcas_main().
It seems that the effect of PixPos() function has a little problem.
Looking forward to your answer and explanation. |
-
2
查看全部评分
-
|