Difference between revisions of "Script Global"
From Virtual World Web Wiki
(Documentation for the Script Global class) |
(Documentation for the Script Global class) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | * This is a JavaScript global object named '''Script''' | |
− | * This is a JavaScript global object named 'Script' | + | |
===Remarks <nowiki>[</nowiki>[{{fullurl:Script Global Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ===Remarks <nowiki>[</nowiki>[{{fullurl:Script Global Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ||
− | {{:Script Global Remarks}} | + | {{#ifexist:Script Global Remarks|{{:Script Global Remarks}}|}} |
===Properties=== | ===Properties=== | ||
Line 20: | Line 19: | ||
===Events=== | ===Events=== | ||
− | :{{CSharp|OnDeselect( | + | :{{CSharp|OnDeselect()}} |
:: | :: | ||
::Event fired when user deselects a DOMRenderable this script is tied to | ::Event fired when user deselects a DOMRenderable this script is tied to | ||
− | :{{CSharp|OnDoubleClick( | + | :{{CSharp|OnDoubleClick()}} |
:: | :: | ||
::Event fired when user double-clicks on DOMObject this script is tied to | ::Event fired when user double-clicks on DOMObject this script is tied to | ||
− | :{{CSharp|OnLeftClick( | + | :{{CSharp|OnLeftClick()}} |
:: | :: | ||
::Event fired when user left-clicks on DOMObject this script is tied to | ::Event fired when user left-clicks on DOMObject this script is tied to | ||
− | :{{CSharp|OnLocalScriptEvent( | + | :{{CSharp|OnLocalScriptEvent()}} |
:: | :: | ||
::Event fired when this script receives a LocalScriptEvent from another script | ::Event fired when this script receives a LocalScriptEvent from another script | ||
− | :{{CSharp|OnMouseLeave( | + | :{{CSharp|OnMouseLeave()}} |
:: | :: | ||
::Event fired when user stops mousing over DOMObject this script is tied to | ::Event fired when user stops mousing over DOMObject this script is tied to | ||
− | :{{CSharp|OnMouseOver( | + | :{{CSharp|OnMouseOver()}} |
:: | :: | ||
::Event fired when user mouses over DOMObject this is tied script to | ::Event fired when user mouses over DOMObject this is tied script to | ||
− | :{{CSharp|OnRightClick( | + | :{{CSharp|OnRightClick()}} |
:: | :: | ||
::Event fired when user right-clicks on DOMObject this script is tied to | ::Event fired when user right-clicks on DOMObject this script is tied to | ||
− | :{{CSharp|OnSelect( | + | :{{CSharp|OnSelect()}} |
:: | :: | ||
::Event fired when user selects a DOMRenderable this script is tied to | ::Event fired when user selects a DOMRenderable this script is tied to | ||
− | :{{CSharp|OnVolumeEnter( | + | :{{CSharp|OnVolumeEnter()}} |
:: | :: | ||
::Event fired when user enters a DOMVolume this script is tied to | ::Event fired when user enters a DOMVolume this script is tied to | ||
− | :{{CSharp|OnVolumeLeave( | + | :{{CSharp|OnVolumeLeave()}} |
:: | :: | ||
::Event fired when user leaves a DOMVolume this script is tied to | ::Event fired when user leaves a DOMVolume this script is tied to | ||
===Methods=== | ===Methods=== | ||
+ | :{{CSharp|void Broadcast(string message, JSObject jsObject {{=}} NULL)}} | ||
+ | :: | ||
+ | ::Triggers an OnLocalScriptEvent event across all client scripts with the given data | ||
+ | |||
+ | :{{CSharp|void BroadcastWithObject(string message, JSDOMObject jsObject)}} | ||
+ | |||
:{{CSharp|void CopyStringToClipboard(string value)}} | :{{CSharp|void CopyStringToClipboard(string value)}} | ||
:: | :: | ||
::Sets a given string as your clipboard data for later pasting | ::Sets a given string as your clipboard data for later pasting | ||
+ | |||
+ | :{{CSharp|void DeleteKey(string key)}} | ||
+ | :: | ||
+ | ::Deletes a value from the client data store. | ||
:{{CSharp|void Exit(string message {{=}} "")}} | :{{CSharp|void Exit(string message {{=}} "")}} | ||
Line 70: | Line 79: | ||
:{{CSharp|ReturnType GetController()}} | :{{CSharp|ReturnType GetController()}} | ||
+ | |||
+ | :{{CSharp|string[] GetEvents()}} | ||
:{{CSharp|float? GetFloat(string key)}} | :{{CSharp|float? GetFloat(string key)}} | ||
Line 99: | Line 110: | ||
::Stop listening to messages on a given script channel | ::Stop listening to messages on a given script channel | ||
− | :{{CSharp| | + | :{{CSharp|JSObject NewObject()}} |
:: | :: | ||
− | :: | + | ::Generates an empty C#-passable object for use with the Broadcast function. |
+ | |||
+ | :{{CSharp|void RaiseLocalScriptEvent(string message, GUIContainer jsObject {{=}} NULL)}} | ||
:{{CSharp|void RequestWebTransfer(string relativeUri)}} | :{{CSharp|void RequestWebTransfer(string relativeUri)}} | ||
Line 126: | Line 139: | ||
:: | :: | ||
::Stores a string value in the client data store, persisting across sessions, keyed to this system. | ::Stores a string value in the client data store, persisting across sessions, keyed to this system. | ||
+ | |||
+ | :{{CSharp|void StartTimer(JSFlexibleFunction callback, int milliseconds)}} | ||
__NOTOC____NOEDITSECTION__ | __NOTOC____NOEDITSECTION__ |
Latest revision as of 14:16, 18 January 2019
- This is a JavaScript global object named Script
Remarks [edit]
Properties
- JSDOMObject Controller {get;}
- Gets the DOM node representing your avatar's controller.
- bool MouseWheelHandled {get; set;}
- string Name {get;}
- Returns the name of this script package
- JSDOMObject Parent {get;}
- If this script originates from a DOMObject, returns that DOMObject
Events
- OnDeselect()
- Event fired when user deselects a DOMRenderable this script is tied to
- OnDoubleClick()
- Event fired when user double-clicks on DOMObject this script is tied to
- OnLeftClick()
- Event fired when user left-clicks on DOMObject this script is tied to
- OnLocalScriptEvent()
- Event fired when this script receives a LocalScriptEvent from another script
- OnMouseLeave()
- Event fired when user stops mousing over DOMObject this script is tied to
- OnMouseOver()
- Event fired when user mouses over DOMObject this is tied script to
- OnRightClick()
- Event fired when user right-clicks on DOMObject this script is tied to
- OnSelect()
- Event fired when user selects a DOMRenderable this script is tied to
- OnVolumeEnter()
- Event fired when user enters a DOMVolume this script is tied to
- OnVolumeLeave()
- Event fired when user leaves a DOMVolume this script is tied to
Methods
- void Broadcast(string message, JSObject jsObject = NULL)
- Triggers an OnLocalScriptEvent event across all client scripts with the given data
- void BroadcastWithObject(string message, JSDOMObject jsObject)
- void CopyStringToClipboard(string value)
- Sets a given string as your clipboard data for later pasting
- void DeleteKey(string key)
- Deletes a value from the client data store.
- void Exit(string message = "")
- Ends this script entirely and optionally sends a message back to the server
- ReturnType GetController()
- string[] GetEvents()
- float? GetFloat(string key)
- Gets a floating point value previously stored in the client data store
- int? GetInteger(string key)
- Gets an integer value previously stored in the client data store
- ReturnType GetMetadata(string key = "")
- Gets metadata from the script context - either the entire serialized block, or just one value if a key is given
- ReturnType GetMetaData(string key = "")
- JSDOMObject GetParent()
- string GetString(string key)
- Gets a string value previously stored in the client data store
- bool ListenOnChannel(int channel, JSFlexibleFunction func)
- Listens for script messages arriving from server scripts on a given channel
- bool MuteChannel(int channel)
- Stop listening to messages on a given script channel
- JSObject NewObject()
- Generates an empty C#-passable object for use with the Broadcast function.
- void RaiseLocalScriptEvent(string message, GUIContainer jsObject = NULL)
- void RequestWebTransfer(string relativeUri)
- Requests an authenticated web URL from the server and immediately navigates to it
- void RequestWebTransferUrl(string relativeUri, JSFlexibleFunction callback)
- Requests an authenticated web URL from the server and invokes the callback function when it is retrieved
- void ServerMessage(string message)
- Sends a message to the server Component this script originated from
- void SetFloat(string key, float value)
- Stores a floating point value in the client data store, persisting across sessions, keyed to this system.
- void SetInteger(string key, int value)
- Stores an integer value in the client data store, persisting across sessions, keyed to this system.
- void SetString(string key, string value)
- Stores a string value in the client data store, persisting across sessions, keyed to this system.
- void StartTimer(JSFlexibleFunction callback, int milliseconds)