Skip to content

Instantly share code, notes, and snippets.

@martindevans
Created August 20, 2012 18:28
Show Gist options
  • Save martindevans/3406456 to your computer and use it in GitHub Desktop.
Save martindevans/3406456 to your computer and use it in GitHub Desktop.
--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