User Tools

Site Tools


scripting:gui

GUI scripting


- Create a Client.lua file in the Scripts folder and put the following contents.

- In Resource Manager, add the test.jpg image file to the Pictures folder.

- Image float (X = 10, Y = 10, Width = 100, Height = 100)

image = Image ("Pictures/test.jpg", Rect (10, 10, 100, 100))

- pop up button, pop-up message when clicked (X = 200, Y = 200, Width = 100, Height = 100)

button = Button ("Ange", Rect (200, 200, 100, 100))
button.onClick.Add (function ()
  Client.ShowAlert ("Wait")
end)

- Create a panel and place text inside the panel

panel = Panel ()
panel.rect = Rect (300, 200, 50, 50)
text = Text ("yahoo", Rect (0, 0, 40, 20))
panel.AddChild (text)

- pop up button, click to display full server message

button = Button ("Ange", Rect (200, 200, 100, 100))
button.onClick.Add (function ()
  Client.FireEvent ("HELLO", "Kids, can you hear me?")
end)

- Create a Server.lua file in the Scripts/Servers folder and put the following contents.

- Handle when event named HELLO comes

Server.GetTopic ("HELLO"). Add (function (text)
  Server.SendCenterLabel (text)
end)
scripting/gui.txt · Last modified: 2019/01/17 05:58 by kernys