Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
AOverlayWindow
displays a QML window inside Interface.
The QML can optionally include a WebView
control that embeds an HTML-based windows. (The WebView
control is defined by a "WebView.qml" file included in the Interface install.) Alternatively, an OverlayWebWindow
can be used for HTML-based windows.
Create using new OverlayWindow(...)
.
Properties
Name | Type | Summary |
---|---|---|
position | Vec2 |
The position of the window, in pixels. |
size | Vec2 |
The size of the window interior, in pixels. |
visible | boolean |
|
Constructor | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
new OverlayWindow( titleOrPropertiesopt, sourceopt, widthopt, heightopt )
Parameters
|
Methods
Name | Return Value | Summary |
---|---|---|
clearDebugWindow
|
None |
Calls a |
close
|
None |
Closes the window. Note: The window also closes when the script ends. |
emitScriptEvent
|
None |
Sends a message to an embedded HTML web page. To receive the message, the HTML page's script must connect to the
|
emitWebEvent
|
None |
Deprecated: This function is deprecated and will be removed. |
getEventBridge
|
object |
Deprecated: This method is deprecated and will be removed. |
getPosition
|
Vec2 |
Gets the position of the window. |
getSize
|
Vec2 |
Gets the size of the window interior. |
hasClosed
|
None |
Deprecated: This method is deprecated and will be removed. |
hasMoved
|
None |
Deprecated: This method is deprecated and will be removed. |
initQml
|
None |
Deprecated: This method is deprecated and will be removed. |
isVisible
|
boolean |
Gets whether the window is shown or hidden. |
qmlToScript
|
None |
Deprecated: This method is deprecated and will be removed. |
raise
|
None |
Raises the window to the top. |
sendToQml
|
None |
Sends a message to the QML. To receive the message, the QML must implement a function:
|
setPosition
|
None |
Sets the position of the window, from a Vec2. |
setPosition
|
None |
Sets the position of the window, from a pair of numbers. |
setSize
|
None |
Sets the size of the window interior, from a Vec2. |
setSize
|
None |
Sets the size of the window interior, from a pair of numbers. |
setTitle
|
None |
Sets the window title. |
setVisible
|
None |
Shows or hides the window. |
Signals
Name | Summary |
---|---|
closed
|
Triggered when the window is closed. |
fromQml
|
Triggered when a message from the QML page is received. The QML page can send a message (string or object) by calling:
|
moved
|
Triggered when the window changes position. |
positionChanged
|
Triggered when the window changes position. |
resized
|
Triggered when the window changes size. |
scriptEventReceived
|
Deprecated: This signal is deprecated and will be removed. |
sizeChanged
|
Triggered when the window changes size. |
visibleChanged
|
Triggered when the window is hidden or shown. |
webEventReceived
|
Triggered when a message from an embedded HTML page is received. The HTML page can send a message by calling:
|
Type Definitions
Properties Type: object |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties used to initialize an OverlayWindow or OverlayWebWindow. Properties
|
Method Details
(static) clearDebugWindow( ) |
---|
Calls a |
(static) close( ) |
---|
Closes the window. Note: The window also closes when the script ends. |
(static) emitScriptEvent( message ) | ||||||
---|---|---|---|---|---|---|
Sends a message to an embedded HTML web page. To receive the message, the HTML page's script must connect to the
Parameters
|
(static) emitWebEvent( message ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) getEventBridge( ) → {object}
Returns: Object. |
---|
Deprecated: This method is deprecated and will be removed. |
(static) getPosition( ) → {Vec2}
Returns: The position of the window, in pixels. |
---|
Gets the position of the window. |
(static) getSize( ) → {Vec2}
Returns: The size of the window interior, in pixels. |
---|
Gets the size of the window interior. |
(static) hasClosed( ) |
---|
Deprecated: This method is deprecated and will be removed. |
(static) hasMoved( position ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This method is deprecated and will be removed. Parameters
|
(static) initQml( properties ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This method is deprecated and will be removed. Parameters
|
(static) isVisible( ) → {boolean}
Returns: code>true if the window is shown, false if it is hidden.
|
---|
Gets whether the window is shown or hidden. |
(static) qmlToScript( message ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This method is deprecated and will be removed. Parameters
|
(static) raise( ) |
---|
Raises the window to the top. |
(static) sendToQml( message ) | ||||||
---|---|---|---|---|---|---|
Sends a message to the QML. To receive the message, the QML must implement a function:
Parameters
Examples
|
(static) setPosition( position ) | ||||||
---|---|---|---|---|---|---|
Sets the position of the window, from a Vec2. Parameters
|
(static) setPosition( x, y ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the position of the window, from a pair of numbers. Parameters
|
(static) setSize( size ) | ||||||
---|---|---|---|---|---|---|
Sets the size of the window interior, from a Vec2. Parameters
|
(static) setSize( width, height ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the size of the window interior, from a pair of numbers. Parameters
|
(static) setTitle( title ) | ||||||
---|---|---|---|---|---|---|
Sets the window title. Parameters
|
(static) setVisible( visible ) | ||||||
---|---|---|---|---|---|---|
Shows or hides the window. Parameters
|
Signal Details
closed(
)
Returns: Signal |
---|
Triggered when the window is closed. |
fromQml(
message
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a message from the QML page is received. The QML page can send a message (string or object) by calling:
Parameters
|
moved(
position
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when the window changes position. Parameters
|
positionChanged(
)
Returns: Signal |
---|
Triggered when the window changes position. |
resized(
size
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when the window changes size. Parameters
|
scriptEventReceived(
message
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Deprecated: This signal is deprecated and will be removed. Parameters
|
sizeChanged(
)
Returns: Signal |
---|
Triggered when the window changes size. |
visibleChanged(
)
Returns: Signal |
---|
Triggered when the window is hidden or shown. |
webEventReceived(
message
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a message from an embedded HTML page is received. The HTML page can send a message by calling:
Parameters
|