The SDialogue class allows you to issue dialogue messages to the player to confirm various actions.
Shows a yes/no dialogue box to the user, and returns the result via the result callback
hostObject = Space.Host.ExecutingObject;
local deltaPos = Vector.New(0,100,0);
local teleportTo = hostObject.WorldPosition + deltaPos;
function teleportMeUp (b)
end
function openDialogue ()
end
hostObject.SubscribeToEvents();
Shows a text input dialogue box to the user, and returns the result via the result callback
hostObject = Space.Host.ExecutingObject;
printToLog = function (s)
end
function openDialogue ()
end
hostObject.SubscribeToEvents();
Opens a URL in a web browser
function openTheWebsite ()
end
hostObject.SubscribeToEvents();
hostObject.OnMouseDown(openTheWebsite);
Sends local chat to the client window
function chatMessage ()
end
hostObject.SubscribeToEvents();
Opens a color picker dialogue. Any change while the color picker is open will trigger onChange(SColor). Clicking 'ok' will trigger onSelect(SColor), and clicking cancel will trigger onCancel(). [Might not work in Editor Pack. Works on Viewer.]
--clicking the object will open a color picker that changes the object's color thisGameObject = Space.Host.ExecutingObject originalColor = thisGameObject.Renderer.Material.GetColor("_Color") OnChange = function(SColor) thisGameObject.Renderer.Material.SetColor("_Color",SColor) end OnSelect = function(SColor) thisGameObject.Renderer.Material.SetColor("_Color",SColor) end OnCancel = function() thisGameObject.Renderer.Material.SetColor("_Color",originalColor) end OnClick = function() Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, originalColor) end thisGameObject.AddClickable() thisGameObject.Clickable.OnClick(OnClick)
|