|
来挖个坟,提供一个比较完美的解决方案(虽然代码写得有点丑)
- Comment: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,code once,function split(inputstr, sep) local t = {} for str in string.gmatch(inputstr, "([^"..sep.."]+)") do _G.table.insert(t, str) end return t end
- Comment: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,code line,p=split(line.text_stripped, "\\N") lmaxwidth=0 for _, c in _G.ipairs(p) do w, _ = _G.aegisub.text_extents(line.styleref, c) lmaxwidth = math.max(lmaxwidth, w) end left = math.floor(line.center - lmaxwidth/2 + 0.5)
- Comment: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,template line noblank keeptags,{\an1\pos(!left!,$bottom)}
复制代码 |
|