AZDev
AZDev

Reputation: 13

How would I create a gui in lua without the use of libraries like that of wxLua?

In my lack of experience I'm not sure if I can ask this in such a way that can be understood.

Basically, I want to make a user interface using raw lua. Is this even possible? If not, how does wxLua create a gui? Does it use another language with a built in GUI library?

I've been trying to figure this out for some time and never find a real answer.

Thanks for the help ahead of time!

Upvotes: 1

Views: 718

Answers (1)

user1277809
user1277809

Reputation: 36

It is possible by using the FFI module of Luajit which can invoke a platform API directly. That is the "raw lua" way to make a user interface.

local ffi = require("ffi")
ffi.cdef[[
int MessageBoxA(void *w, const char *txt, const char *cap, int type);
]]
ffi.C.MessageBoxA(nil, "Hello world!", "Test", 0)

Upvotes: 2

Related Questions