This commit is contained in:
2026-03-18 22:00:21 +02:00
parent 691ec08e88
commit da326ddf96
4 changed files with 100 additions and 87 deletions
+10 -2
View File
@@ -8,7 +8,7 @@ let engine = null;
export default {
async mounted(){
this.engine = engine = new GameEngine();
engine = new GameEngine();
await engine.init(this.$refs.target, {
xr: true,
gizmo: this.env == 'GameDesigner',
@@ -32,7 +32,8 @@ export default {
window.removeEventListener('resize', this.resize);
engine.tm?.setGame(null);
engine.dispose();
this.debug('Disposed scene', engine.renderer.info.memory)
this.debug('Disposed scene', engine.renderer.info.memory);
engine = null;
},
computed:{
@@ -307,6 +308,13 @@ export default {
async fullScreen(){
await engine.renderer.domElement.requestFullscreen()
},
async setGameHeader(){
let screenshot = await engine.captureScreenshot();
let fd = new FormData();
fd.append('file', screenshot);
await this.$api.game.setHeader(this.modelValue.id, fd);
}
}
}