Live2D看板娘详细教程

Live2D看板娘详细教程

前言:

网络上教程有很多,搜索关键字“Live2D看板娘”,

  1. 首先博客园要先申请JS权限
  2. 添加代码就可以实现

博客园申请JS权限步骤:

点击此处进入博客园申请JS权限步骤

申请步骤放到上边的链接里了,有些人申请JS权限一次两次都不行是什么原因?可能是你写的不够礼貌!

这里放一个范本,是其他网友写的,很礼貌!我试了一次就开通了!

点击此处进入礼貌用语

添加相关代码:

右下角版(人物:课桌上的小女孩):

css:

#live2dcanvas {
    border: 0 !important;
}

js:

<script type="text/javascript" charset="utf-8"  src="https://files.cnblogs.com/files/liuzhou1/L2Dwidget.0.min.js"></script>
<script type="text/javascript" charset="utf-8"  src="https://files.cnblogs.com/files/liuzhou1/L2Dwidget.min.js"></script>
<script type="text/javascript">
    L2Dwidget.init({"display": {
        "superSample": 2,
        "width": 200,
        "height": 400,
             "position": "right",
                 "hOffset": 0,
        "vOffset": 0
          }
     });
</script>

保存即可!

点击进入右下角版链接

左下角版

刚刚突然找到了一个可以换装可以变装的左下角版本!

自己试了试成功了

我把教程放到下边

点击此处进入左下角版本

他这里第三步代码有问题保存不了,我这里把修改后的代码粘过来。

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Live2D</title>
    <link rel="stylesheet" type="text/css" href="https://files.cnblogs.com/files/yjlblog/flat-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="https://files.cnblogs.com/files/kousak/waifu.css"/>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
    <link rel="stylesheet" type="text/css" href="https://files.cnblogs.com/files/kousak/waifu.css">
    <div class="waifu" id="waifu">
        <div class="waifu-tips" style="opacity: 1;"></div>
        <canvas id="live2d" width="280" height="250" class="live2d"></canvas>
        <div class="waifu-tool">
            <span class="fui-home"></span>
            <span class="fui-chat"></span>
            <span class="fui-eye"></span>
            <span class="fui-user"></span>
            <span class="fui-photo"></span>
            <span class="fui-info-circle"></span>
            <span class="fui-cross"></span>
        </div>
    </div>
    <script src="https://files.cnblogs.com/files/kousak/live2d.js"></script>
    <script src="https://files.cnblogs.com/files/kousak/waifu-tips.js"></script>
    <script type="text/javascript">initModel()</script>
</body>
</html>

按照上边的代码,可以正确的做出左下角版本!

如果想两个版本的都做怎么办?

简单!!!!*

只需要把右下角版本的内容,复制到左下角版本的倒数第三行

点击此处跳转看板娘透明攻略

posted @ 2020-12-31 13:32  Godwin_Zhang  阅读(806)  评论(1编辑  收藏  举报