From 98aae707e1adc579da57038a6eb4cf0a9d3ac9cd Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Tue, 12 Sep 2017 14:19:44 +0200 Subject: [PATCH] Updated GUI (markdown) --- GUI.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/GUI.md b/GUI.md index 1b31ae9..c6cddbb 100644 --- a/GUI.md +++ b/GUI.md @@ -5,48 +5,48 @@ To be done, here's a quick LUA script with GUI stuff though, it'll add an 'optio -------------------------------- Artemis LUA file -------------------------------- ---------------------------------------------------------------------------------- function openWindow() - local window = Gui.CreateWindow("Test", 1270, 720); + local window = Gui.CreateWindow("Test", 1270, 720) -- Textbox - local textBox = window.CreateTextBox("", 5, 5, 200, 25); - local textBoxLabel = window.CreateLabel("Type something in the textbox", 210, 5); + local textBox = window.CreateTextBox("", 5, 5, 200, 25) + local textBoxLabel = window.CreateLabel("Type something in the textbox", 210, 5) function textChangedHandler(textBox) - textBoxLabel.Text = "You typed: " .. textBox.Text; + textBoxLabel.Text = "You typed: " .. textBox.Text end - textBox.TextChanged.add(textChangedHandler); + textBox.TextChanged.add(textChangedHandler) -- Button - local button = window.CreateButton("Press me :D", 5, 45, 200, 25); - local buttonLabel = window.CreateLabel("Press the button", 210, 43); - local pressCount = 1; + local button = window.CreateButton("Press me :D", 5, 45, 200, 25) + local buttonLabel = window.CreateLabel("Press the button", 210, 43) + local pressCount = 1 function buttonClickHandler(button) - buttonLabel.Text = "You pressed " .. pressCount .. " time(s)"; - pressCount = pressCount + 1; + buttonLabel.Text = "You pressed " .. pressCount .. " time(s)" + pressCount = pressCount + 1 end - button.Click.add(buttonClickHandler); + button.Click.add(buttonClickHandler) -- ComboBox - local comboBox = window.CreateComboBox("Value 2", {"Value 1", "Value 2", "Value 3"}, 5, 85, 200, 25); - local comboBoxLabel = window.CreateLabel("Select a value", 210, 83); + local comboBox = window.CreateComboBox("Value 2", {"Value 1", "Value 2", "Value 3"}, 5, 85, 200, 25) + local comboBoxLabel = window.CreateLabel("Select a value", 210, 83) function selectionChangedHandler(comboBox) - comboBoxLabel.Text = "You selected: " .. comboBox.Value; + comboBoxLabel.Text = "You selected: " .. comboBox.Value end - comboBox.SelectionChanged.add(selectionChangedHandler); + comboBox.SelectionChanged.add(selectionChangedHandler) -- CheckBox local checkBox = window.CreateCheckBox("Checkbox label", true, 5, 125) - local checkBoxLabel = window.CreateLabel("Uncheck the checkbox", 210, 120); + local checkBoxLabel = window.CreateLabel("Uncheck the checkbox", 210, 120) function checkBoxClickHandler(checkBox) if checkBox.IsChecked then - checkBoxLabel.Text = "Checkbox is checked"; + checkBoxLabel.Text = "Checkbox is checked" else - checkBoxLabel.Text = "Checkbox is not checked"; + checkBoxLabel.Text = "Checkbox is not checked" end end - checkBox.Click.add(checkBoxClickHandler); + checkBox.Click.add(checkBoxClickHandler) end -Gui.AddEditorButton("Options", openWindow); +Gui.AddEditorButton("Options", openWindow) ``` \ No newline at end of file