예제 #1
0
        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);
        }
예제 #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)));
        }
예제 #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);
        }
예제 #4
0
        public void loadPhysics(String path)
        {
            IPlatformManager pm = Live2DFramework.getPlatformManager();

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

            if (debugMode)
            {
                pm.log("Load Pose : " + path);
            }
            pose = L2DPose.load(pm.loadBytes(path));
        }
예제 #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;
        }