【发布时间】:2018-08-25 16:15:21
【问题描述】:
我是 Lua 的新手,但目前正在为 tic-80 项目编写库存屏幕。我一直在尝试创建一个函数来绘制更改变量值的按钮。大量的谷歌搜索和一些实验导致了这一点:
function drawButton(x,y,sprite,target,action).
[Drawing button stuff here]
if md==true and mx<=x+12 and mx>=x and my<=y+12 and my>=y then
_G[target]=action
end
end
这适用于变量:
drawButton (12,12,0,"eqf",1)
但是当我尝试更改表中的值时,它什么也没做。
drawButton (12,12,0,"actors.player.eqf",1)
有没有更好的方法也支持表格? 提前致谢!
【问题讨论】:
标签: lua