changed the size of canvas

This commit is contained in:
2024-09-20 02:39:28 +02:00
parent 05c9ec6c88
commit a876a6226e
2 changed files with 4 additions and 4 deletions

View File

@@ -16,7 +16,7 @@
</head>
<body>
<!-- 创建一个 canvas 元素来承载 Live2D 模型 -->
<canvas id="canvas"></canvas>
<canvas id="canvas" width='800' height="800"></canvas>
<!-- 引入 PixiJS 和 pixi-live2d-display -->
<script src="https://www.luoyangdonghui.de/wp-content/uploads/live2d_test16/live2d/live2d.min.js"></script>
@@ -38,13 +38,13 @@
});
// 加载 Live2D 模型(确保 'shizuku.model.json' 在正确的路径中)
const model = await PIXI.live2d.Live2DModel.from('https://www.luoyangdonghui.de/wp-content/uploads/live2d_test16/live2d/model/pichu/index.json');
const model = await PIXI.live2d.Live2DModel.from('./model/pichu/index.json');
// 将模型添加到应用的舞台
app.stage.addChild(model);
// 设置模型的初始位置、旋转、缩放和锚点
model.x = 200;
model.x = 300;
model.y = 500;
model.rotation = Math.PI;
model.skew.x = Math.PI;

View File

@@ -24,7 +24,7 @@ function loadWidget() {
sessionStorage.removeItem("waifu-text");
document.body.insertAdjacentHTML("beforeend", `<div id="waifu">
<div id="waifu-tips"></div>
<canvas id="live2d" width="800" height="800"></canvas>
<canvas id="live2d" width="1200" height="800"></canvas>
<div id="waifu-tool">
<span class="fa fa-lg fa-music"></span>
<span class="fa fa-lg fa-comment"></span>