I'm having trouble understanding the v2 reference documentation for creating gui control objects. Basically I just want to make a GUI with text where when some action occurs, like clicking a button or moving a mouse to a certain area on the screen, the text will change color or maybe change into a new message. I have successfully used the ControlSetText function to change the text, but I think I need to use Gui Control Objects to change other properties of the text. Here's my code currently:
Code: Select all
MyGui := Gui()
MyGui.SetFont("s12")
MyText := MyGui.Add("Text", "x10 y10", "Initial GUI text")
MyButton := MyGui.Add("Button", "x10 y50", "Click me!")
MyButton.OnEvent("Click", MyButton_Click)
MyGui.Show("Center")
MyButton_Click(*) {
ControlSetText("New button text", MyText)
}