- Tutorials:
stbSurfaceManager provides API to work with multiple surface instances.
Members
(static, readonly) list :Array.<stbSurface>
Get array of all available stbSurface
instances in the system.
The order of surfaces in this list is the same as they are visible on the screen.
The surface with zero index is the farthest from the observer:
surface:0 > surface:1 > surface:2 > surface:3 > observer
Type:
- Array.<stbSurface>
Example
// get surface #0 instance
var surf = stbSurfaceManager.list[0];
Methods
(static) setOrder(order) → {boolean}
Set order information for all surfaces.
Works only in case valid list of surfaces is provided.
Amount of items should match stbSurfaceManager.list
size.
All items should be instances of stbSurface
.
Use stbSurfaceManager.list
to get current ordered list of surfaces.
Example
if ( !stbSurfaceManager.setOrder([s3, s2, s1]) ) {
console.log('was not able to reorder!');
}
Parameters:
Name | Type | Description |
---|---|---|
order |
Array.<stbSurface> | new ordered list of surfaces |
Returns:
operation status
- Type
- boolean
(static) swap(surface1, surface2) → {boolean}
Switch two given surfaces.
Works only in case valid stbSurface
instances are provided.
Example
var sBrowser = stbSurfaceManager.list[0],
sPlayer = stbSurfaceManager.list[2];
// these two calls are equivalent
stbSurfaceManager.swap(sBrowser, sPlayer);
stbSurfaceManager.swap(sPlayer, sBrowser);
Parameters:
Name | Type | Description |
---|---|---|
surface1 |
stbSurface | first surface instance to swap |
surface2 |
stbSurface | second surface instance to swap |
Returns:
operation status
- Type
- boolean
(static) reset()
Restore the default surfaces order.
Usual order: browser, players.