new xutils()
Stub for jsdoc, a collection of common methods
NOTE: no 'xutils.' prefix when calling functions.
This class name is all in lower case. X-visual use this convention for a
collection of common global methods when using jsdoc generating API doc.
- Source:
Methods
(static) cssColor(min) → {array}
Get color array that's common in shader uniform parameter format
Stolen from
Three.js/Color#setStyle.
Parameters:
Name | Type | Description |
---|---|---|
min |
number |
- Source:
Returns:
color [r, g, b], without 'a'.
- Type
- array
(static) exports.splash(splashImgId, xworker, src)
Splashing screean helper.
See AnthonyWJones' Answer @ stackoverflow
Parameters:
Name | Type | Description |
---|---|---|
splashImgId |
string | |
xworker |
function | the long rounner |
src |
string | image |
- Source:
Example
splash("mySplashDiv", longRunner)
function longRunner() {
//This may take a while
}
(static) ramTexture(w, h, options) → {Unit8Array}
Get a texture generated in memory.
Parameters:
Name | Type | Description |
---|---|---|
w |
number | 0 - 1 |
h |
number | 0 - 1 |
options |
object | alpha: 0 - 1 |
- Source:
Returns:
size = w * h * 4
- Type
- Unit8Array
(static) randInt(min, maxopt)
Get a randome integer, between min (0), max
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
min |
number | ||
max |
number |
<optional> |
- Source:
(static) randomColor() → {string}
Get a randome color
- Source:
Returns:
e.g. '0x0f3271'
- Type
- string
(static) randomRGB() → {THREE.Color}
Get a randome color
- Source:
Returns:
color
- Type
- THREE.Color
(static) sleep(ms)
example: await sleep(1000);
Parameters:
Name | Type | Description |
---|---|---|
ms |
number |
- Source: