(Beginner) 5. Concatenate Strings
Login
-
Join
Home
Games
Game Engine
Resources
Tutorials
Description:
Show how to put parts of text together in Lua.
Author:
LastEnd
Topic:
Scripting
Last Tutorial:
(Beginner) 4. Functions
Next Tutorial:
(Beginner) 6. Loops
Script:
Scripting_RegisterClass("engine") Scripting_RegisterClass("ui") happy = false -- Do not edit this method. It is generated by the visual designer function InitializeComponent() dialog = UI.Dialog.Add("dialog", 0, 0, 1280, 703, true, -16777216, -16777216, -16777216, -16777216, 0, -987833, "", 0, false, true, true, false, true, "Arial", 24, false, false) lblHello = UI.Label.Add("lblHello", dialog, [[Message]], 211, 118, 403, 67, 0, 0, "Segoe UI", 22, false, false, -1) Window_Resize() end--* -- Do not edit this method. It is generated by the visual designer function Window_Resize() local _width = Engine.GetWindowWidth() local _height = Engine.GetWindowHeight() UI.Dialog.SetSize(dialog, _width, _height) end--* function setMessage(msg) UI.Label.SetText(dialog, lblHello, msg) end function init() InitializeComponent() local message = "Hello World! I am a attribute." if happy == true then setMessage(message) else local notHappyMessage = message .. " This world sucks." setMessage(notHappyMessage) end end init()
ALL COMMENTS (
0
)
You need to
LOGIN
or
SIGN UP
before you can post comments.
Policy
-
Support
-
Contact
-
Terms of Service
-
Lost Serial
-
Site Map
-
Feedback