You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A project launched using the Vue3 template, I don't know why it keeps repeatedly rendering the DOM
App.vue
<script setup>
import Phaser from 'phaser';
import { ref, toRaw } from 'vue';
import PhaserGame from './game/PhaserGame.vue';
import '@/assets/font/font.css'
// The sprite can only be moved in the MainMenu Scene
const canMoveSprite = ref();
// References to the PhaserGame component (game and scene are exposed)
const phaserRef = ref();
// This event is emitted from the PhaserGame component:
const currentScene = (scene) => {
canMoveSprite.value = (scene.scene.key !== 'MainMenu');
}
</script>
Version
Description
Example Test Code
Additional Information
A project launched using the Vue3 template, I don't know why it keeps repeatedly rendering the DOM
<script setup> import Phaser from 'phaser'; import { ref, toRaw } from 'vue'; import PhaserGame from './game/PhaserGame.vue'; import '@/assets/font/font.css' // The sprite can only be moved in the MainMenu Scene const canMoveSprite = ref(); // References to the PhaserGame component (game and scene are exposed) const phaserRef = ref(); // This event is emitted from the PhaserGame component: const currentScene = (scene) => { canMoveSprite.value = (scene.scene.key !== 'MainMenu'); } </script>App.vue
main.js
const config = {
type: Phaser.AUTO,
width: window.innerWidth * 4,
height: window.innerHeight * 4,
parent: 'game-container',
backgroundColor: '#fcc1db',
scale: {
mode: Phaser.Scale.FIT,
},
scene: [
Game
]
};
const StartGame = (parent) => {
return new Phaser.Game({ ...config, parent });
}
PhaserGame.vue
Game.js
The text was updated successfully, but these errors were encountered: