How do I make something like local menuB={ B1="string" } ?
4 replies, posted
I am trying to figure out a way to create something like this:
[code]local menuButton={
B1 = ["String"],
}[/code]
Any tips?
You're not being very specific. Provide context and describe what you're trying to do.
I want to create a global variable like I showed in first post.
I want to use it on this:
[code]b1:SetText(propButton[B1])[/code]
So I can alter the button names without going through the code too much.
[lua]
local menuButton = {
B1 = "string value"
}
-- or
local menuButton = {
["B1"] = "string value"
}
-- then
b1:setText(propButton["B1"])
[/lua]
[QUOTE=Khub;46240860][lua]
local menuButton = {
B1 = "string value"
}
-- or
local menuButton = {
["B1"] = "string value"
}
-- then
b1:setText(propButton["B1"])
[/lua][/QUOTE]
Thank you very much :)
Sorry, you need to Log In to post a reply to this thread.