Now I already now how to change the color of text in CC-Lua, but I know Lua is a little different. Well I'm making this "Personal Assistant" thingy on my iPod with a app called "TouchLua", and well it does what its title suggests, its my assistant, lol, well its written fully in regular Lua, not CC-Lua, but let me get to the real problem, so I wanted to know how you would mimic "term.setTextColor(colors.<a Color>)" into regular Lua. And "term.setCursorPos(<coords>)".
[Lua][Question]Color
Started by Spongy141, Apr 13 2013 04:46 PM
3 replies to this topic
#1
Posted 13 April 2013 - 04:46 PM
#2
Posted 13 April 2013 - 05:55 PM
There is no such thing in regular Lua. Unless your app provides a way of GUI interaction then I am afraid you are stuck with a text-based system. There are several Lua GUI bindings such as wxLua for a full-blown installation of Lua on a computer (oftentimes they are operating system specific), but unfortunately I do not know of any for an IOS device; Implementation would probably be fiendishly difficult.
Edit: If the app does provide some sort of visual interaction, you will most likely be able to find it by cycling through the _G environment table like so:
You'll probably have to look through a lot of global variables/functions/tables, but hey you might find something useful in the process.
Edit: If the app does provide some sort of visual interaction, you will most likely be able to find it by cycling through the _G environment table like so:
for i,v in pairs(_G) do print(i..": "..type(v)) end
You'll probably have to look through a lot of global variables/functions/tables, but hey you might find something useful in the process.
#3
Posted 13 April 2013 - 06:25 PM
Bubba, on 13 April 2013 - 05:55 PM, said:
There is no such thing in regular Lua. Unless your app provides a way of GUI interaction then I am afraid you are stuck with a text-based system. There are several Lua GUI bindings such as wxLua for a full-blown installation of Lua on a computer (oftentimes they are operating system specific), but unfortunately I do not know of any for an IOS device; Implementation would probably be fiendishly difficult.
Edit: If the app does provide some sort of visual interaction, you will most likely be able to find it by cycling through the _G environment table like so:
You'll probably have to look through a lot of global variables/functions/tables, but hey you might find something useful in the process.
Edit: If the app does provide some sort of visual interaction, you will most likely be able to find it by cycling through the _G environment table like so:
for i,v in pairs(_G) do print(i..": "..type(v)) end
You'll probably have to look through a lot of global variables/functions/tables, but hey you might find something useful in the process.
#4
Posted 13 April 2013 - 09:18 PM
iOS runs on Unix or something, IIRC, so you should be able to do something like this:
This is ANSI escape code, which works with basically everything except for the Windows commandline.
You can learn more about it here:
http://en.wikipedia....NSI_escape_code
The colour-range is very limited, though, unless you're using xterm-256, which supports full RGB text.
print("\033[31;0m<your text here>") -- Print some red text.
This is ANSI escape code, which works with basically everything except for the Windows commandline.
You can learn more about it here:
http://en.wikipedia....NSI_escape_code
The colour-range is very limited, though, unless you're using xterm-256, which supports full RGB text.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











