对于我正在处理的游戏,用户必须绘制一条线,一个对象将跟随该线。对我来说,用户的行是图形然后做这样的事情(用户的行被称为" userLine")
是合乎逻辑的。move the image "xyz" to the points of graphic "userLine"
是否可以让用户绘制图形?
答案 0 :(得分:0)
查看choose
命令。这应该可以帮到你。
开始画线: (例如,这可能是一个按钮脚本。但是你想触发用户绘图。)
if there is a graphic "userLine" then
delete graphic "userLine"
end if
set the style of the templateGraphic to "line"
set the selectionHandleColor to the effective backgroundcolor of this card
choose graphic tool
然后在卡片脚本中添加以下处理程序:
on newGraphic
choose browse tool
set the selectionHandleColor to black
set the name of graphic (the number of graphics) to "userLine"
move btn "radio" to the points of grc "userLine" in 2 seconds
end newGraphic
这种情况的一些变化应该有效。