Im trying to create a class for creating buttons… Something like this.
function newButton() newButton = widget.newButton{ width = 100, height = 70, sheet = buttonSheetDark, topLeftFrame = 1, topMiddleFrame = 2, topRightFrame = 3, middleRightFrame = 4, bottomRightFrame = 5, bottomMiddleFrame = 6, bottomLeftFrame = 7, middleLeftFrame = 8, middleFrame = 9, topLeftOverFrame = 10, topMiddleOverFrame = 11, topRightOverFrame = 12, middleRightOverFrame = 13, bottomRightOverFrame = 14, bottomMiddleOverFrame = 15, bottomLeftOverFrame = 16, middleLeftOverFrame = 17, middleOverFrame = 18, label = "", onPress = "", font = "", fontSize = "", labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0, 0.5 } }, x = 0, --125 y = 0 } return newButton end
Im calling it with this
button = settings.newButton()
And then trying to set certain properties manually, which I cant figure out how to do. Ive tried the following with no luck.
button[23].onPress = onSoundTouch
button[24] = font1
button.fontSize = 36
How can I set these table options manually after the button has already been created?