Class: Model

Model()

Live2Dモデルを操作するオブジェクト

Constructor

new Model()

Source:
Example
function start(){
    console.log("parameters",model.parameters.length)
    console.log("parts",model.parts.length)
    console.log("drawables",model.drawables.length)
    console.log("motions",model.motions.length)
    console.log("expressions",model.expressions.length)
}

Members

drawables :Array.<Drawable>

描画オブジェクトの一覧
Type:
Source:

expressions :Array.<Expression>

表情(exp3.json)の一覧
Type:
Source:

motions :Array.<Motion>

モーション(motion3.json)の一覧
Type:
Source:

multiplyColor :Color

乗算色
Type:
Source:
Example
function start(){
    model.multiplyColor="#00ff00"
    console.log(model.multiplyColor)
}

parameters :Array.<Parameter>

パラメータの一覧
Type:
Source:

parts :Array.<Part>

パーツの一覧
Type:
Source:

screenColor :Color

スクリーン色
Type:
Source:
Example
function start(){
    model.screenColor="#ff0000"
    console.log(model.screenColor)
}

Methods

drawable(id) → {Drawable}

描画オブジェクトを取得する。
Parameters:
Name Type Description
id string IDが無い場合は名前で検索する
Source:
Returns:
Type
Drawable

expression(name) → {Expression}

表情を取得する。
Parameters:
Name Type Description
name string ファイル名またはmodel3.jsonに記載の名前
Source:
Returns:
Type
Expression

motion(name) → {Motion}

モーションを取得する。
Parameters:
Name Type Description
name string
Source:
Returns:
Type
Motion

move(param)

モデルを移動する
Parameters:
Name Type Description
param Object 設定オブジェクト。
Properties
Name Type Attributes Default Description
PositionX number <optional>
X座標
PositionX number <optional>
Y座標
Scale number <optional>
大きさ
Rotation number <optional>
回転
Delay number <optional>
1 完了までの秒数
Absolute boolean <optional>
false 絶対座標で移動するかどうか
InterpolationType string <optional>
"Linear" 補間方法
Source:
Example
model.move({
    Rotation: 90,
    Delay: 3
  })

parameter(id) → {Parameter}

パラメータを取得する。
Parameters:
Name Type Description
id string IDが無い場合は名前で検索する
Source:
Returns:
Type
Parameter

part(id) → {Part}

パーツを取得する。
Parameters:
Name Type Description
id string IDが無い場合は名前で検索する
Source:
Returns:
Type
Part

stopMotion()

再生中のモーションを終了する関数
Source: