public void loadModelData(String path) { IPlatformManager pm = Live2DFramework.getPlatformManager(); if (debugMode) { pm.log("Load model : " + path); } live2DModel = pm.loadLive2DModel(path); live2DModel.saveParam(); if (Live2D.getError() != Live2D.L2D_NO_ERROR) { pm.log("Error : Failed to loadModelData()."); return; } var w = live2DModel.getCanvasWidth(); var h = live2DModel.getCanvasHeight(); modelMatrix = new L2DModelMatrix(w, h); if (w > h) { modelMatrix.setWidth(2); } else { modelMatrix.setHeight(2); } modelMatrix.setCenterPosition(0, 0); }