new Player(group, settingsopt)
3D objects animation.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
group |
THREE.Group | THREE.Scene | THREE.Group or THREE.Scene of the meshes for playing. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
settings |
Object |
<optional> |
{} | the following settings are available
Properties
|
Classes
Namespaces
- assign
- execFunc
- getColors
- getItemSize
- getPoints
- selectMeshPlayScene
- selectPlayScene
- setColorAttribute
- onChangeRepeat
Methods
addSlider()
Adds slider menu item into CanvasMenu.
addSliderEvents()
Adds an events into slider menu item of the CanvasMenu.
Returns:
slider element
continue()
Continue playing asynchronously. Usual using if creating new scene to take long time. Please call it from settings.options.onSelectScene() function after asynchronously creating of the scene. Return true from settings.options.onSelectScene() function for pause of the playing.
createCanvasMenuItem(canvasMenu, getLanguageCodeopt)
Adds a Player's menu item into CanvasMenu.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
canvasMenu |
CanvasMenu | CanvasMenu. | ||
getLanguageCode |
function |
<optional> |
"en" | Your custom getLanguageCode() function.
returns the "primary language" subtag of the language version of the browser. Examples: "en" - English language, "ru" Russian. See the rfc4646 2.1 Syntax for details. Default returns the 'en' is English language. You can import { getLanguageCode } from '../../commonNodeJS/master/lang.js'; |
createControllersButtons(options)
Adds player buttons into web page.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | the following options are available
Properties
|
getSelectSceneIndex()
Returns:
selected scene index.
getSettings()
Returns:
Player settings.
getTime(timeIdopt)
get time
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
timeId |
number |
<optional> |
Index of the time. The default is the time index of the selected scene. |
getTimeId()
get time id
gui(folderopt)
Adds a Player's controllers into dat.gui.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
folder |
GUI |
<optional> |
Player's folder |
localization(getLanguageCodeopt)
PlayController localization
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
getLanguageCode |
function |
<optional> |
"en" | Your custom getLanguageCode() function.
returns the "primary language" subtag of the language version of the browser. Examples: "en" - English language, "ru" Russian. See the rfc4646 2.1 Syntax for details. Default returns the 'en' is English language. You can import { getLanguageCode } from '../../commonNodeJS/master/lang.js'; |
Returns:
Names and titles of the PlayController controls
next()
Go to next animation scene
onChangeScale(scale)
Changes the "max" value of the slider of the player's menu. Moves Player to the first scene.
Parameters:
Name | Type | Description |
---|---|---|
scale |
Object | See options.playerOptions parameter of MyThree class. |
play3DObject()
User has clicked the Play ► / Pause ❚❚ button
prev()
Go to previous animation scene
pushController(controller)
Add controller into controllers array
Parameters:
Name | Type | Description |
---|---|---|
controller |
controller |
repeat()
User has clicked the repeat ⥀ button
selectScene(index)
select scene for playing
Parameters:
Name | Type | Description |
---|---|---|
index |
number | Index of the scene. Range from 0 to options.playerOptions.marks - 1 |
Returns:
false - invalid index.
setIndex(index, title)
Sets index and title of the slider element of the player's menu.
Parameters:
Name | Type | Description |
---|---|---|
index |
string | |
title |
string |
setTime(t)
set time
Parameters:
Name | Type | Description |
---|---|---|
t |
number | time |
Returns:
false - invalid t.