-
Notifications
You must be signed in to change notification settings - Fork 0
/
zamasu.html
50 lines (44 loc) · 2.12 KB
/
zamasu.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Live2D 看板娘 / Demo</title>
</head>
<!------ 位置可自定义 ------>
<div class="Canvas" style="position: fixed; left: 10px; bottom: 10px;z-index: 99999999" id="L2dCanvas"></div>
<!------ 依赖 JS | Dependent JS ------>
<!---- 可选 | Optional ---->
<!-- 兼容低版本浏览器 | Compatible with low-level browsers -->
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"> </script>
<!-- 音频播放兼容 | Audio playback compatible -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/howler.min.js"></script>
<!---- 必需 | Required ---->
<script src="https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script>
<!-- live2dv3.js -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/live2dv3.min.js"></script>
<!------ 加载Live2d模型 | Load Live2d model ------>
<script>
window.onload = () => {
new l2dViewer({
el: document.getElementById('L2dCanvas'),
basePath: 'https://cdn.jsdelivr.net/gh/D-0000000000/zamasutest/',
modelName: 'zamasu'
})
}
</script>
<body>
<!-- Live2DCubismCore script -->
<script src="https://cdn.jsdelivr.net/gh/D-0000000000/zamasutest/zamasu/js/live2dcubismcore.js"></script>
<!-- Build script -->
<script src="https://cdn.jsdelivr.net/gh/D-0000000000/zamasutest/zamasu/js/bundle.js"></script>
<canvas id="live2d" width="500" height="500" class="live2d"
style="position: fixed; opacity: 1; right: -50px; bottom: 20px; z-index: 99999; pointer-events: none;"></canvas>
<script type="text/javascript">
var resourcesPath = 'https://cdn.jsdelivr.net/gh/D-0000000000/zamasutest/'; // 指定资源文件(模型)保存的路径
var backImageName = ''; // 指定背景图片
var modelDir = ['zamasu']; // 指定需要加载的模型
initDefine(resourcesPath, backImageName, modelDir); // 初始化模型
</script>
</body>
</html>