<script setup lang="ts">
import GAME_INIT from '../../public/static/cocos-loader/creator-load';
import web2game from './web2game';
setTimeout(() => {
	init()
}, 200)

function init() {
	GAME_INIT(() => {
		web2game.loadScene('helloworld').then((scenename) => {
			console.log(123)
			web2game.updateResolution(this.STUDENT_SIZE, this.ratio)
			this.$emit('sceneLoaded') // 发给父组件初始化完毕，这时去掉遮罩
		})
	})
}
</script>

<template>
	<div id="GameDiv" class="studentSize">
		<canvas id="GameCanvas"></canvas>
	</div>
</template>



<style lang='scss'>
#GameDiv {

	//   position: absolute;
	//   top: 50%;
	//   left: 50%;
	//   transform: translate(-50%, -50%);
	// &.teacherSize {
	//   width: 1012px;
	//   height: 455px;
	// }
	&.studentSize {
		width: 1280px;
		height: 720px;
	}
}

#GameCanvas {
	display: block;
	touch-action: none;
	user-select: none;
	cursor: default;
	border-radius: 5px;
}

canvas:focus {
	outline: none;
}
</style>