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();
string okbutton, Action< SColor > onChange, Action< SColor > onSelect, Action onCancel,
SColor defaultColor );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().
Parameters title The title of the color picker window, choose something brief and appropriate like 'Select a wall color' okbutton The title of the 'OK' button, should indicate the action e.g. 'Adjust Wall' onChange A callback event, will fire multiple times as the user adjusts the color onSelect A callback event, indicates the final color selected by the user onCancel A callback event, fires when the user clicks the Cancel button defaultColor The color to open the colour picker with
--clicking the object will open a color picker than changees object's color thisGameObject = Space.Host.ExecutingObject OnChange = function(SColor) thisGameObject.Renderer.Material.SetColor("_Color",SColor) end OnSelect = function(SColor) thisGameObject.Renderer.Material.SetColor("_Color",SColor) end OnCancel = function() Space.Log("no color was chosen") end OnClick = function() Space.Dialogues.ColorPicker("title","okbutton", OnChange, OnSelect, OnCancel, Color.Red) end thisGameObject.AddClickable() thisGameObject.Clickable.OnClick(OnClick)
|