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);
        }
Exemple #2
0
        public void loadExpression(String name, String path)
        {
            IPlatformManager pm = Live2DFramework.GetPlatformManager();
            if (debugMode) pm.log("Load Expression : " + path);

            expressions.Add(name, L2DExpressionMotion.loadJson(pm.loadBytes(path)));
        }
Exemple #3
0
        public void loadTexture(int no, String path)
        {
            IPlatformManager pm = Live2DFramework.GetPlatformManager();
            if (debugMode) pm.log("Load Texture : " + path);

            pm.loadTexture(live2DModel, no, path);
        }
        public void loadPhysics(String path)
        {
            IPlatformManager pm = Live2DFramework.getPlatformManager();

            if (debugMode)
            {
                pm.log("Load Physics : " + path);
            }
            physics = L2DPhysics.load(pm.loadBytes(path));
        }
        public void loadPose(String path)
        {
            IPlatformManager pm = Live2DFramework.getPlatformManager();

            if (debugMode)
            {
                pm.log("Load Pose : " + path);
            }
            pose = L2DPose.load(pm.loadBytes(path));
        }
Exemple #6
0
        public AMotion loadMotion(String name, String path)
        {
            IPlatformManager pm = Live2DFramework.GetPlatformManager();
            if (debugMode) pm.log("Load Motion : " + path);

            Live2DMotion motion = null;

            byte[] buf = pm.loadBytes(path);
            motion = Live2DMotion.loadMotion(buf);

            if (name != null)
            {
                motions.Add(name, motion);
            }

            return motion;
        }