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

 找回密码
 新人加入
查看: 3467|回复: 4
打印 上一主题 下一主题

问下在文本行里面规定的pos可以在template里面取得坐标么? [复制链接]

Rank: 4

楼主
发表于 2017-1-9 16:11:38 |显示全部楼层
为什么我现在运行会报错了?难道是aegisub版本问题?

Rank: 4

沙发
发表于 2017-1-9 16:12:11 |显示全部楼层
Failed to parse Lua code: [string "template code"]:1: invalid escape sequence near '"{.*'
Code that failed to parse: function GetPosition()  x,y=string.match(line.raw,"{.*\pos%((%-?%d+%.?%d*),(%-?%d+%.?%d*)%).*}")  return x.." "..y end

Runtime error in template expression: [string "return (GetPosition())"]:1: attempt to call global 'GetPosition' (a nil value)
Expression producing error: GetPosition()
Template with expression: !GetPosition()!

Rank: 4

板凳
发表于 2017-1-9 18:04:37 |显示全部楼层
去掉大括号那些就成功了。

Rank: 4

地板
发表于 2017-1-9 18:51:05 |显示全部楼层
"{.+\\pos%((%-?%d+%.?%d*),(%-?%d+%.?%d*)%).+}"

Rank: 4

5#
发表于 2017-1-9 19:52:06 |显示全部楼层
{.*\\pos%((%-?%d+%.?%d*),(%-?%d+%.?%d*)%).*}
您需要登录后才可以回帖 登录 | 新人加入

GitHub|TCAX 主页

GMT+8, 2024-5-2 23:26

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部
RealH