Difference between revisions of "Script Global"
From Virtual World Web Wiki
(Documentation for the Script Global class) |
(Documentation for the Script Global class) |
||
Line 67: | Line 67: | ||
:: | :: | ||
::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 73: | Line 77: | ||
:{{CSharp|ReturnType GetController()}} | :{{CSharp|ReturnType GetController()}} | ||
+ | |||
+ | :{{CSharp|string[] GetEvents()}} | ||
:{{CSharp|float? GetFloat(string key)}} | :{{CSharp|float? GetFloat(string key)}} |
Revision as of 12:32, 23 May 2018
- 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 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.