Line 51: | Line 51: | ||
− | {{ScriptFunction|void|ColorPicker|(string title, | + | {{ScriptFunction|void|ColorPicker|(string title, 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()|5=<pre>--clicking the object will open a color picker than changees object's color |
− | 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() | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
thisGameObject = Space.Host.ExecutingObject | thisGameObject = Space.Host.ExecutingObject |
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()
--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)
|