Hero192 Posted February 26, 2016 Share Posted February 26, 2016 Can any one explain that? I see alot of scripters create GUI elements and define them with a empty table, can I know why that? For example: local GUI = {} GUI["window"] = {} GUI["window"][1] = guiCreateWindow( ... ) Thanks in advance.. Link to comment
Bonus Posted February 26, 2016 Share Posted February 26, 2016 To create a table and fill it later ... Link to comment
Hero192 Posted February 27, 2016 Author Share Posted February 27, 2016 To create a table and fill it later ... I mean, what's the difference if I created a GUI without defining it with a table, and without a table Link to comment
Captain Cody Posted February 27, 2016 Share Posted February 27, 2016 Nothing really, just makes it easier to sort the buttons. Link to comment
ozulus Posted February 27, 2016 Share Posted February 27, 2016 local GUI = {} GUI["label"] = {} GUI["label"][1] = guiCreateLabel( ... ) GUI["label"][2] = guiCreateLabel( ... ) GUI["label"][2] = guiCreateLabel( ... ) for _, guiElement in ipairs(GUI["label"]) do guiSetVisible(guiElement, true) end -- or guiSetVisible(GUI["label"][1], true) guiSetVisible(GUI["label"][2], true) guiSetVisible(GUI["label"][3], true) -- Both usage is the same. But the first usage look like clear than second one. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now