xiazeyu / live2d-widget.js Goto Github PK
View Code? Open in Web Editor NEWLive2D on webpages with out-of-the-box experience.
Home Page: https://l2dwidget.js.org/
License: GNU Affero General Public License v3.0
Live2D on webpages with out-of-the-box experience.
Home Page: https://l2dwidget.js.org/
License: GNU Affero General Public License v3.0
L2DTargetPoint.FRAME_RATE = 60;
in Live2DFramework.js参数配置如下:
<script src="/assets/live2dw/lib/L2Dwidget.min.js"></script>
<script>L2Dwidget.init({
"pluginRootPath": "live2dw/",
"pluginJsPath": "lib/",
"pluginModelPath": "assets/",
"tagMode": false,
"debug": false,
"model": {"jsonPath": "/assets/live2dw/assets/unitychan.model.json"},
"display": {"position": "right", "width": 120, "height": 180},
"mobile": {"show": true, "scale": 0.02},
"log": false
});</script>
在电脑端能够跟随model.width、model.height而改变大小,但移动端的大小始终如一,一个示意图如下:
请问是否是移动端的参数有什么黑科技?
还是我哪里设置的不对?
我的博客网址:https://www.oukohou.wang/
谢谢,致礼!
I have alreday read instructions in CONTRIBUTING.
我已仔细阅读CONTRIBUTING中的相关内容。
I have alreday read instructions in README.
我已仔细阅读README中的相关内容。
Migrated from EYHN/hexo-helper-live2d#43
提取到的一些模型含有久置动作,想把这些动作利用起来。
例如鼠标停留或移出浏览器窗口指定时间后触发
this.models[i].startRandomMotion(cDefine.MOTION_GROUP_PINCH_IN,
cDefine.PRIORITY_NORMAL);
this.models[i].startRandomMotion(cDefine.MOTION_GROUP_PINCH_OUT,
cDefine.PRIORITY_NORMAL);
// unused motion: flick_head
// unused motion: pinch_in
// unused motion: pinch_out
// unused motion: shake
描述你的问题
启用hitokoto后,浏览器的控制台会有一下报错(但不影响使用)
出现问题的网站地址: https://l2dwidget.js.org/dev.html
额外的信息
请在此处描述其他的内容
我已仔细阅读CONTRIBUTING中的相关内容。
我已仔细阅读README中的相关内容。
使用webpack 4
运行时报错
Cannot assign to read only property 'exports' of object
追查原因是src/dialog/index.js
中import
与module.exports
混用...
import { config } from '../config/configMgr';
import { L2Dwidget } from '../index';
...
module.exports = {
createDialogElement, displayDialog, hiddenDialog, alertText, showHitokotoLoop
}
使用webpack 4
运行时报错
Identifier 'aE' has already been declared
Identifier 't' has already been declared
追查原因是 src/lib/live2d.core.js
中function aE()
和function t()
确实定义了2次...
第一次3133-3168
行
第二次4871-4906
行
考虑去除4871-4906
行?live2d.core.js-4871
设备: [PC]
操作系统: [MACOS]
浏览器 [Chrome 73]
live2d-widget: [3.1.3]
我已仔细阅读CONTRIBUTING中的相关内容。
我已仔细阅读README中的相关内容。
高考爆炸...
描述你的问题
哑巴现象1:带语音模型不发声
哑巴现象2:dialog配置无效
初次入坑live2d,在github上找到了崩崩中的德莉莎live2d模型,里面带有语音包。我的博客使用nuxt手工搭建,在找到你的项目之前,在npm里找到了live2d-vue-component组件并使用,语音能正常使用。
在使用你的项目时,不传入模型,用默认的配置加载出来的live2d模型点击有音效,该设置自己的模型后无效。因为readme中Setting的文档连接已经失效,我不好判断是不是需要加什么设置。所以只能在这提出来了。
项目中README-SCRIPT.md文档有关于dialog的配置说明,但按照上面说的配置无效
复现步骤
L2Dwidget.init({
// pluginModelPath: 'http://cloud.qiniu.lroyia.top/static/live2dw/model/',
tagMode: true,
// debug: false,
model: { jsonPath: 'http://cloud.qiniu.lroyia.top/static/live2dw/model/Terisa/model.json' },//已全部挂着到个人七牛云中
//model: { jsonPath: '/live2d/Terisa/model.json' },//博客实际使用静态路径,因七牛云https收费,博客使用了https,因此直接将模型放在项目的静态目录上了
display: { position: 'right', width: 300, height: 650},
// mobile: { show: true },
// log: false,
dialog: {
// 开启对话框
enable: true,
script: {
// 每空闲 10 秒钟,显示一条一言
'every idle 1s': 'test',
//当触摸到星星图案
'hover .info-box .author>a': '点击这里可以返回到首页哦~',
// 当触摸到角色身体
'tap body': '哎呀!别碰我!',
// 当触摸到角色头部
'tap face': '人家已经不是小孩子了!'
}
}
})
出现问题的网站地址:https://blog.lroyia.top
加载命令:
// 点击有语音的默认模型配置
L2Dwidget.init({
tagMode: true,
display: { position: 'right', width: 300, height: 650},
dialog: {
// 开启对话框
enable: true,
script: {
// 每空闲 10 秒钟,显示一条一言
'every idle 1s': 'test',
//当触摸到星星图案
'hover .info-box .author>a': '点击这里可以返回到首页哦~',
// 当触摸到角色身体
'tap body': '哎呀!别碰我!',
// 当触摸到角色头部
'tap face': '人家已经不是小孩子了!'
}
}
});
// 点击无语音的个人模型配置
L2Dwidget.init({
tagMode: true,
model: { jsonPath: 'http://cloud.qiniu.lroyia.top/static/live2dw/model/Terisa/model.json' },//已全部挂着到个人七牛云中
//model: { jsonPath: '/live2d/Terisa/model.json' },//博客实际使用静态路径,因七牛云https收费,博客使用了https,因此直接将模型放在项目的静态目录上了
display: { position: 'right', width: 300, height: 650},
dialog: {
// 开启对话框
enable: true,
script: {
// 每空闲 10 秒钟,显示一条一言
'every idle 1s': 'test',
//当触摸到星星图案
'hover .info-box .author>a': '点击这里可以返回到首页哦~',
// 当触摸到角色身体
'tap body': '哎呀!别碰我!',
// 当触摸到角色头部
'tap face': '人家已经不是小孩子了!'
}
}
});
控制台输出:
无报错
预期的行为
10秒空闲会弹出test的dialog,点击模型可以发出语音
屏幕截图
无
环境信息(请务必填写下列信息)
使用
npm ls live2d-widget
来获取当前插件版本.
额外的信息
请在此处描述其他的内容
我已仔细阅读CONTRIBUTING中的相关内容。(404)
我已仔细阅读README中的相关内容。
将
[ ]
变为[x]
来表示我接受了这些问题。
现在功能比较单一,于是自己简单加上了拖拽、放大缩小、右键菜单(感觉以后都会有
但是现在只能在init
之后使用轮训来查找dom
,找到后再绑定相应的事件...😷
配置中添加钩子,如config.hook.afterCreate
在elementMgr.js
53行
document.body.appendChild(newElem)
后
添加config.hook.afterCreate()
根据情况应该考虑开放更多的钩子方法吧
Migrated from EYHN/hexo-helper-live2d#65
Migrated from EYHN/hexo-helper-live2d#72
Describe the bug
"idle": [
{"file": "mtn/idle_01.mtn", "fade_in": 2000, "fade_out": 2000},
{"file": "mtn/idle_02.mtn", "fade_in": 2000, "fade_out": 2000},
{"file": "mtn/idle_03.mtn", "fade_in": 2000, "fade_out": 2000},
{"file": "mtn/idle_04.mtn", "fade_in": 2000, "fade_out": 2000}
]
我在 "idle" 中设置了4个动作,使用 Live2D 的 SampleApp 加载时,模型会不断随机这 4 个动作。但是当我用 hexo-helper-live2d 加载到博客中时,每次刷新页面只会随机加载一个,然后再也不会随机到另外三个动作,而是不断重复加载到的这个动作。
Migrated from EYHN/hexo-helper-live2d#90
https://github.com/avgjs/pixi-live2d/blob/master/src/lib/MatrixStack.js#L89
https://github.com/avgjs/pixi-live2d/blob/master/src/lib/glMatrix-mat4.js
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array
https://github.com/avgjs/pixi-live2d/blob/master/src/lib/glMatrix-common.js
https://msdn.microsoft.com/en-us/library/windows/desktop/bb153169(v=vs.85).aspx
http://blog.csdn.net/schrodinger1900/article/details/52734568
http://glmatrix.net/docs/module-mat4.html
Migrated from EYHN/hexo-helper-live2d#14
TBD.
Single file
Single file UMD
no polyfill
3.0上导出的模型并不能使用(
有没有什么方法实现3.0转2.0或者是其他的轮子...?
Migrated from EYHN/hexo-helper-live2d#59
Migrated from EYHN/hexo-helper-live2d#58
I want to destroy L2Dwidget instance before user leave this page
Network request should only be make when requiring a certain .mtn file for the first time. And the same file should be loaded from cache for subsequent requests.
当且仅当第一次请求某个动作文件时发出网络请求。后续对同一个文件的请求应该从缓存中获取。
Network requests are made each time requiring the same .mtn file.
请求同一个 .mtn 文件会发送多个网络请求。
config / 配置如下:
live2d:
enable: true
scriptFrom: local
model:
use: local-model
display:
position: right
width: 125
height: 250
hOffset: 50
mobile:
show: false
react:
opacityDefault: 1
P.S. Actually, I'm using the hexo-helper-live2d
plugin. But, I think it should be a issue for this repo. / 实际上,我是用的是 hexo-helper-live2d
插件,但是我认为这应该是这个仓库的模块的问题。
L2Dwidget.0.min.js:2618 Live2D 2.1.00_1
L2Dwidget.0.min.js:2615 profile : Desktop
L2Dwidget.0.min.js:2615 [PROFILE_NAME] = Desktop
L2Dwidget.0.min.js:2615 [USE_ADJUST_TRANSLATION] = false
L2Dwidget.0.min.js:2615 [USE_CACHED_POLYGON_IMAGE] = false
L2Dwidget.0.min.js:2615 [EXPAND_W] = 2
L2Dwidget.0.min.js:551 dump exception : _$gi _$C _$li , _$Q0 _$P0.
L2Dwidget.0.min.js:551 stack :: undefined
最后面两行的错误
Migrated from EYHN/hexo-helper-live2d#32
将scaling调至大于1时,由于实际大小与显示大小不同,所以鼠标指针的跟随也会出现问题,右下角无法识别
Migrated from EYHN/hexo-helper-live2d#29
Migrated from EYHN/hexo-helper-live2d#93
To prepare for the College Entrance Examination, I decided to put the project off for a year.
为了准备高考, 我准备将此项目搁置一年.
Any question please contant EYHN.
Thanks for all your supports. See you next summer vacation.
│ .babelrc
│ .codeclimate.yml
│ .czrc
│ .editorconfig
│ .esdoc.json
│ .eslintignore
│ .eslintrc.js
│ .gitignore
│ .gitmodules
│ .mdlrc
│ .npmignore
│ .travis.yml
│ CHANGELOG.md
│ jsconfig.json
│ LICENSE
│ package-lock.json
│ package.json
│ playground.html
│ README.md
│ TO-DO.md
│ webpack.config.js
│ yarn.lock
├───.github
│ │ CODE_OF_CONDUCT.md
│ │ CONTRIBUTING.md
│ │ ISSUE_TEMPLATE.md
│ │ PULL_REQUEST_TEMPLATE.md
│ └───ISSUE_TEMPLATE
│ bug-report-----.md
│ bug_report.md
│ feature-request------.md
│ feature_request.md
├───.vscode
│ settings.json
├───build
│ afterBuild.js
│ afterCIBuild.js
│ deployDocs.sh
│ generator.html
│ getProjPath.js
│ id_rsa.enc
│ playgroundProduction.html
│ playgroundProductionv3.html
│ ssh_config
└───src
│ elementMgr.js
│ index.js
│ index_.js
│ main.js
│ main_.js
│ Model.js
│ ModelManager.js
│ Model_.js
│ Storage.js
├───config
│ configMgr.js
│ configStorage.js
├───lib
│ BaseModel.js
│ ExpressionMotion.js
│ ExpressionParam.js
│ EyeBlink.js
│ live2d.core.nodoc.js
│ MotionManager.js
│ PartsParam.js
│ Physics.js
│ polyfill.nodoc.js
│ Pose.js
│ setEnv.nodoc.js
│ TargetPoint.js
├───tmplate
│ innerHTML.html
└───utils
Matrix.js
ModelSettingJson.js
pathHandler.js
PlatformManager.js
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
where are the online generator? sorry, i don't understand. i need help.
如题,好希望可以添加看板娘的提示话语,不知道怎么弄~
Migrated from EYHN/hexo-helper-live2d#63
more from pixi-live2d and live2d.core api
页面内成功渲染(init
)过一次模型后,更换配置后再次渲染不生效(不刷新页面)...
发现配置src/config/configMgr.js
做了更改 不知此处的更改是何故
从src/config/defaultsDeep.js
现有逻辑来看
var val = target[key];
// add the missing property, or allow a null property to be updated
if (val == null) {
target[key] = value;
} else if (typeof val === 'object' && val !== null && typeof value === 'object' && value !== null) {
defaultsDeep(val, value);
}
第一次渲染后target
(currConfig
)每一项都有值,再次渲染后if else
并不会更新target
的值,也就是少考虑了val
为string
的情况?
还原此处更改 考虑到事出有因,似乎不可取
上述if else
逻辑改为(直接一个else
可能欠妥?不知道还有没有其他情况)
if (typeof val === 'object' && val !== null && typeof value === 'object' && value !== null) {
defaultsDeep(val, value);
} else {
target[key] = value;
}
且src/config/configMgr.js
中28行
defaultsDeep(currConfig, userConfig, defaultConfig);
更改为
defaultsDeep(currConfig, defaultConfig, userConfig);
设备: [PC]
操作系统: [MACOS]
浏览器 [Chrome 73]
live2d-widget: [3.1.4]
我已仔细阅读CONTRIBUTING中的相关内容。
我已仔细阅读README中的相关内容。
最近在写一个react项目,使用了typescript,请问这个插件如何在typescript中使用?
dump exception : _$gi _$C _$li , _$Q0 _$P0.
L2Dwidget.0.min.js:551 stack :: undefined
你的新功能与某一个问题有关吗?
请简明清晰地描述你的问题, 例如: 我常常因为 [...] 而失望
你的方案是
请简明清晰地描述你的方案
一些你考虑过的替代方案有
请简明清晰地描述你的考虑过的替代方案或功能
额外的信息
请在此处描述其他的内容或者一些有关此功能的截图
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.