首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Hexo-live2D添加

Hexo-live2D添加

作者头像
闲花手札
发布2021-08-24 11:46:16
发布2021-08-24 11:46:16
3980
举报
文章被收录于专栏:闲花手札闲花手札

安装插件

npm install --save hexo-helper-live2d

等待加载就OK!

添加配置

hexo的配置文件 _config.yml 中添加如下配置:

代码语言:javascript
复制
# 看板娘
live2d:
    enable: true # 是否开启看板娘
    scriptFrom: local
    pluginRootPath: live2dw/
    pluginJsPath: lib/
    pluginModelPath: assets/
    tagMode: false
    log: false
    model:
        use: live2d-widget-model-shizuku # 模型名称
    display:
        superSample: 2 # rate for super sampling rate 超采样等级
        position: right # Left of right side to show 显示位置:左或右
        width: 150 # Width to the canvas which shows the model canvas的长度
        height: 300 # Height to the canvas which shows the model canvas的高度
        hOffset: 75 # Horizontal offset of the canvas canvas水平偏移
        vOffset: -20 # Vertical offset of the canvas canvas垂直偏移
    mobile:
        show: true # Whether to show on mobile device 是否在移动设备上显示
        scale: 0.5 # Scale on mobile device 移动设备上的缩放
    react:
        opacity: 0.7 # opacity 透明度
    name:
        canvas: 'live2dcanvas' # ID name of the canvas canvas元素的ID
        div: 'live2d-widget' # ID name of the div div元素的ID
    dev:
        border: false # Whether to show border around the canvas 在canvas周围显示边界
    dialog:
        enable: false # Display dialog 显示人物对话框
        hitokoto: false # Enable hitokoto 使用一言API

选择模型

下面提供模型参考图可根据需求选择

模型参考示例

可根据下列模型昵称选择自己喜欢的,如hijiki一只黑色的猫

进行安装模型时 npm install --save live2d-widget-model-hijiki

参考图提供width,height可供参考(配置文件 _config.yml 下修改)

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-03-14,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装插件
  • 添加配置
  • 选择模型
  • 模型参考示例
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档