TCAX 字幕特效制作工具官方论坛 | ASS | TCAS | Python | Aegisub | Lua

 找回密码
 新人加入
查看: 2954|回复: 4

[已解决] TextOutlineDraw [复制链接]

Rank: 4

发表于 2013-9-21 22:21:12 |显示全部楼层
本帖最后由 Alex 于 2013-9-21 22:25 编辑

Hi

I tried to  use TextOutlineDraw function, and i wrote everything properly
but I don't know why i can't see the draw text ?
  1. from tcaxPy import *
  2. from extLibs.XXParticleSystem import *


  3. def tcaxPy_Init():
  4.     global _Fs
  5.     global Font
  6.     _Fs = GetVal(val_FontSize)
  7.     Font = InitFont(GetVal(val_FontFileName), GetVal(val_FaceID), _Fs, GetVal(val_Spacing), GetVal(val_SpaceScale), 0xFFFFFF, 0, 0)


  8. def tcaxPy_Fin():
  9.     FinFont(Font)


  10. def tcaxPy_Main(_i, _j, _n, _start, _end, _elapk, _k, _x, _y, _a, _txt):

  11.     ASS_BUF  = []         
  12.     TCAS_BUF = []        

  13.     dx = _x  
  14.     dy = _y  

  15.     outline = TextOutlineDraw(Font, _txt, dx, dy)

  16.     t0 = _start - 50 + _j * 7
  17.     t1 = t0 + 50
  18.     t2 = _start + _elapk
  19.     t3 = _start + _elapk + _k
  20.     t4 = _end - 60 + _j * 7
  21.     t5 = t4 + 50


  22.     ass_main(ASS_BUF, SubL(t2, t2 + 100, 6, Pix_Style), pos(dx,dy) + an(8) + fad(0, 600) + color1('ffffff') + alpha1(0) + alpha3(HexToDec('77')) + blur(5) + bord(5) + t(bord(0)), '{\\p7}' + outline )

  23.     ass_main(ASS_BUF, SubL(t0, t5, 5, Pix_Style), pos(dx,dy) +an(8) + fad(400, 400) + alpha1(0) + blur(1.3) + color1('000000'), '{\\p7}' + outline )



  24.     return (ASS_BUF, TCAS_BUF)
复制代码

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

发表于 2013-9-23 21:50:48 |显示全部楼层
use pos(0, 0) instead of pos(dx, dy), since the offset had already been specified in TextOutlineDraw(Font, _txt, dx, dy), thus the vector drawing will contain the position info.

Rank: 4

发表于 2013-9-24 16:21:38 |显示全部楼层
milkyjing 发表于 2013-9-23 21:50
use pos(0, 0) instead of pos(dx, dy), since the offset had already been specified in TextOutlineDraw ...

I know that offset had already been specified in TextOutlineDraw function

but the position is vertically rather than horizontally, I don't know why -_-

Administrator

TCAX Dev.

Rank: 7Rank: 7Rank: 7

发表于 2013-9-24 21:36:50 |显示全部楼层
Alex 发表于 2013-9-24 16:21
I know that offset had already been specified in TextOutlineDraw function

but the position is ver ...

check the tcc file, set < text layout = horizontal >

for your reference. http://www.tcax.org/forum.php?mod=viewthread&tid=304

Rank: 4

发表于 2013-10-26 01:25:32 |显示全部楼层
thank you very much
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-4-19 03:14

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH