Created
August 20, 2012 18:28
-
-
Save martindevans/3406456 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Tags:[ui, message box] | |
--Author:Martin Evans | |
function Initialize(owner, initialisationData) | |
Scene.LoadService("UI.UiService"); | |
local chatPipe = Pipes.GetPipe("General Chat", "String", true, true); | |
Ui.AddCallback("SendChatMessage", function(msg) | |
chatPipe.Send(msg); | |
end); | |
chatPipe.Subscribe(function(msg) | |
Ui.ExecuteJavascript("ReceiveChatMessage", msg); | |
end); | |
--Load the message box javascript into the UI (if it's already been loaded, it'll be written over) | |
Ui.ExecuteJavascript(Resource.Load("BehaviourScripts/ChatBox.js").AsText()); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment