UI

  • Create a Client.lua file in the Scripts folder and add the following contents.

  • Add the test.jpg image file to the Resource Manager Pictures folder.

  • Float the image (X=10, Y=10, Width=100, Height=100)

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

-- Change image
-- ex1
image.image = "Icons/01.png"
--ex2
image.SetImage("Icons/05.png")
  • Float the button and click to display a message popup (X=200, Y=200, width=100, height=100)

button = Button("Hello", Rect(200, 200, 100, 100))
button.onClick.Add(function()
  Client.ShowAlert("Hello")
end)
  • Create a panel and place text inside it

panel = Panel()
panel.rect = Rect(300, 200, 50, 50)
text = Text("Yahoo", Rect(0, 0, 40, 20))
panel.AddChild(text)
  • Delete the button that appears after clicking the button

  • Change button color

  • Pop up a button and click to post a message to the entire server

  • Create a Server.lua file in the Scripts/Servers folder and put the following content in it.

  • Process when an event called HELLO arrives

  • Adjusting with basic UI scripts

  • Adjusting the basic ScreenUI

  • Output image file name

Last updated