Members
live :Live
アプリケーション全体で使用される設定情報。
Type:
- Since:
- 1.0.0
- Source:
model :Model
モデル
Type:
- Since:
- 1.0.0
- Source:
scene :Scene
シーン
Type:
- Since:
- 1.0.0
- Source:
Methods
onDestroy()
モデル削除の直前に呼ばれる関数
- Source:
Example
function onDestroy(){
}
onDisable()
スクリプトが無効になったときに呼ばれる関数
- Source:
Example
function onDisable(){
model.multiplyColor = "" //色を戻す
}
onEnable()
スクリプトが有効になったときに呼ばれる関数。
- Source:
Example
function onEnable(){
console.log(model.name)
}
onKeyDown(key)
キー押し下げ時に呼ばれる関数
Parameters:
Name | Type | Description |
---|---|---|
key |
String | A~Z,Ctrl,Shift,Altなど。 |
- Source:
Example
function onKeyDown(key) {
if (key == "Ctrl+A") {
if (model.motions.length > 0) {
model.motions[0].start()
}
}
}
onKeyUp(key)
キーを離した時に呼ばれる関数
Parameters:
Name | Type | Description |
---|---|---|
key |
String | A~Z,Ctrl,Shift,Altなど。 |
- Source:
Example
function onKeyUp(key){
console.log(key)
}
onMouseDown(x, y, button)
マウスボタン押し下げ時に呼ばれる関数
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | 0 ~ 画面の幅。左側が0 |
y |
Number | 0 ~ 画面の高さ。上が0 |
button |
Number | 1:左,2:右,4:中央 |
- Source:
Example
function onMouseDown(x,y,button){
console.log(x.toFixed(2),y.toFixed(2))
}
onMouseMove(x, y)
マウス移動時に呼ばれる関数
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | 0 ~ 画面の幅。左側が0 |
y |
Number | 0 ~ 画面の高さ。上が0 |
- Source:
Example
function onMouseMove(x,y){
}
onMouseUp(x, y, button)
マウスボタン解放時に呼ばれる関数
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | 0 ~ 画面の幅。左側が0 |
y |
Number | 0 ~ 画面の高さ。上が0 |
button |
Number | 1:左,2:右,4:中央 |
- Source:
Example
function onMouseUp(x,y,button){
}
paint(painter)
描画時に毎回呼ばれる関数
Parameters:
Name | Type | Description |
---|---|---|
painter |
Painter |
- Source:
Example
function paint(painter){
painter.clear()
painter.drawText(10,10,"hello")
}
start()
モデルスクリプトの初期化が終わったときに呼ばれる関数。
onEnableよりも後のタイミング。起動時に複数のモデルやアイテムがある場合はそれらの読み込み後に呼ばれる。
- Source:
Example
function start(){
console.log(model.name)
}
update(params)
更新時に毎回呼ばれる関数
Parameters:
Name | Type | Description |
---|---|---|
params |
LiveParameters | トラッキングパラメーターを管理するオブジェクト(モデルスクリプトのみ) |
- Source:
Example
function update(params){
params.Yaw = params.Yaw * 2 //顔の左右の動きを大きくする
}