vue-plugin-live2d 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/Live2D.vue +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-plugin-live2d",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "Vue 3 <Live2D> component — mount @doki-land/live2d with props, progress UI, and lifecycle.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"vue": "^3.4.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@doki-land/live2d": "0.0.
|
|
40
|
+
"@doki-land/live2d": "0.0.25"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false
|
|
43
43
|
}
|
package/src/Live2D.vue
CHANGED
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
|
|
29
29
|
<script setup lang="ts">
|
|
30
30
|
import {
|
|
31
|
-
|
|
31
|
+
createLive2d,
|
|
32
32
|
createRenderer,
|
|
33
33
|
type FrameProfile,
|
|
34
34
|
focusParameterUpdates,
|
|
35
|
-
type
|
|
35
|
+
type Live2dRuntime,
|
|
36
36
|
type LoadProgress,
|
|
37
37
|
type ModelSource,
|
|
38
38
|
type PlayMotionOptions,
|
|
@@ -78,7 +78,7 @@ const loadProgress = ref<LoadProgress | null>(null);
|
|
|
78
78
|
const loading = ref(false);
|
|
79
79
|
|
|
80
80
|
let _canvas: HTMLCanvasElement | null = null;
|
|
81
|
-
let runtime:
|
|
81
|
+
let runtime: Live2dRuntime | null = null;
|
|
82
82
|
let raf = 0;
|
|
83
83
|
let lastTs = 0;
|
|
84
84
|
let manualAngleX: number | null = null;
|
|
@@ -146,7 +146,7 @@ function ensureFreshCanvas(): HTMLCanvasElement | null {
|
|
|
146
146
|
return next;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
function bindRuntimeEvents(r:
|
|
149
|
+
function bindRuntimeEvents(r: Live2dRuntime) {
|
|
150
150
|
r.events.on("ready", (p) => {
|
|
151
151
|
loading.value = false;
|
|
152
152
|
loadProgress.value = {
|
|
@@ -190,7 +190,7 @@ async function remount() {
|
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
runtime =
|
|
193
|
+
runtime = createLive2d({
|
|
194
194
|
renderer: createRenderer({ prefer: props.prefer }),
|
|
195
195
|
});
|
|
196
196
|
bindRuntimeEvents(runtime);
|