Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Button(pX, pY, pText, pColorText, pColorOn, pColorOff, pEnabled)
- self = {X = pX, Y =pY, Text = pText, ColorText = pColorText, ColorBack = pColorOn, ColorOff = pColorBackOff, Enabled = pEnabled}
- local toggle = function()
- self.Enabled = not self.Enabled
- end
- local getState = function()
- return self.Enabled
- end
- return {
- toggle = toggle,
- getState = getState
- }
- end
- b1 = Button(10, 10, "Hallo", 1, 2, 2, false)
- print(b1.getState())
- b1.toggle()
- print(b1.getState())
Add Comment
Please, Sign In to add comment