【问题标题】:Running Lua code on Android在 Android 上运行 Lua 代码
【发布时间】:2018-04-07 08:03:22
【问题描述】:

我有一个简单的 GUI 程序,它有 2 个用于输入数字的文本字段和一个用于获取这些数字总和的按钮。它使用portable IUP 作为 GUI 元素:

require( "iuplua" )

t1 = iup.text{}
t2 = iup.text{}
btn = iup.button {title = "SUM:"}
qbtn = iup.button{title="Quit"}
reslab = iup.label{}

function btn:action()
    v1 = tonumber(t1.value)
    v2 = tonumber(t2.value)
    resstr = string.format("%d", (v1 + v2))
    reslab.title = resstr
    dlg:show()
end
function qbtn:action()
    os.exit()
    end

dlg = iup.dialog {
 iup.vbox{
    iup.hbox{
        iup.label{title="First:"},
        t1  },
    iup.hbox{
        iup.label{title="Second:"},
        t2  },
    iup.hbox{
        btn,
        reslab  },
    iup.hbox{
        iup.label{},
        qbtn,
        iup.label{} } }, 
 title = "BMI"}

dlg:show()
iup.MainLoop() 

如何在 Android 中运行这个简单的程序?我找不到适用于 Android 的 IUP 指南。是否需要用其他一些 GUI 库重写?哪一个/好?谢谢你的帮助。

【问题讨论】:

  • 如果您想使用 Lua 编写移动应用程序/游戏,请查看 coronalabs.com

标签: android lua iup


【解决方案1】:

目前,没有适用于 Android 的 IUP。有一个原型,如上一次 Lua Workshop (2017) 中所见,但还没有准备好。 抱歉,我不是 Android 开发者,没有任何建议。

【讨论】:

  • 我的第一个想法是“悲伤!”,因为我喜欢 IUP。但后来我意识到有个好消息:它正在开发中。 耶!(我讨厌 Android,但它是 IUP 可以保护我们免受其侵害的必要邪恶。)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-06-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多