2,226 questions
0
votes
1
answer
79
views
Disable multiple keys in phaser 3
I use the right arrow key for my character’s movement. The problem is, when I press another key at the same time, the movement stops. Is there a way to keep the character moving even when other keys ...
0
votes
1
answer
99
views
Disabling Bootstrap event delegation for specific DOM elements
Environment
Bootstrap version: 5.3.3
Browser: Chrome (latest)
Framework: Vue.js 3 with Phaser 3.87.0
Problem Description
I'm developing a game using Phaser 3 within a Vue.js application that uses ...
2
votes
1
answer
44
views
Is it possible to run a function inside Phaser 3, this.input.on dragstart?
I am writing a game of Solitaire in Phaser 3 and want to run a function inside of this.input.on('dragstart', .... I can drag a single card inside of dragstart, but I need a function to work out which ...
1
vote
1
answer
88
views
Phaser setting FPS is incorrect?
I am setting the FPS in my Phaser game like this:
const config = {
type: window.Phaser.AUTO,
width: window.innerWidth,
height: window.innerHeight,
scene: GameScene,
physics: {
default: &...
1
vote
1
answer
45
views
cursors is not defined at Game.update (Phaser 3)
I'm currently learning Phaser and decided to use this Vite template (https://github.com/phaserjs/template-vite). These are the changes I've made:
Boot.js:
import { Scene } from 'phaser';
export ...
1
vote
1
answer
63
views
Phaser.js: mismatch between coordinates for graphics and Matter.js body
I'm trying to mathematically create some shape graphics in Phaser.js, and to attach matching Matter.js physics bodies to them. I'm finding that the coordinate systems used for these two things don't ...
0
votes
1
answer
56
views
How to make dom elements stay in it's place when camera scroll in phaser
I need to make my dom elements stay in it's place when the camera scroll in phaser. I tried setting setScrollFactor(0) but doesn't work. Is there other solution aside from updating dom elements ...
1
vote
1
answer
78
views
Manipulate matter.js Body
I run into an issue with generated bodies in matter.js.
if i generate a body from svg via:
Matter.Svg.pathToVertices(svgPath, 1)
It can happen that the generated Body consists of more shapes like ...
0
votes
1
answer
39
views
Insert Image between, before or after texts in phaser 3
I want to combine text and an image in Phaser 3 and place them inside a container. What is the most efficient way to achieve this? Ideally, the layout should adapt to the container’s width. Is there a ...
3
votes
2
answers
162
views
Create physics body from svg in phaser with matter.js
I'm loading a svg as xml in the preload function:
this.load.xml("xml-pipe-bottom", "assets/svg/shape_pipe_b.svg");
and create a body and the svg as sprite:
const shapeBody = this....
0
votes
2
answers
103
views
How to detect fullscreenchange if it came from pressing f11
I'm creating a function for full screen via pressing f11 or from icon. What is the efficient way to detect if the fullscreenchange event came from pressing f11 below is my code going full screen by ...
0
votes
0
answers
24
views
Preventing Exit from Full Screen When Pressing F11 Twice in JavaScript [duplicate]
I'm wondering why I can exit full screen when I have a flag that should prevent the user from pressing F11 twice. Please don't tell me to use once I just need to know the reason. Fyi this is just an ...
0
votes
1
answer
71
views
In phaser 3 what is the efficient way to transition from portrait to landscape and vice versa
import Phaser from 'phaser';
import PlayScene from './PlayScene';
import PreloadScene from './PreloadScene';
import QuestionScene from './QuestionScene';
import NotificationBannerScene from './...
1
vote
2
answers
73
views
After zooming in the main camera, how do I get a sprite's zoomed in viewport coordinates?
On a default Phaser project, I have a sprite positioned at 100, 100.
I want to get its coordinates when zoomed in to place an absolute div on top of it in HTML.
On zoom 1 this works:
const ...
1
vote
1
answer
43
views
Spine2D Atlas 404 Error in Phaser with Webpack 5
When I try to load Spine2D's atlas in Phaser, using Webpack 5, I receive 404 for the skeleton.png asset.
// File: skeleton.atlas
skeleton.png
size:2046,1890
filter:Linear,Linear
...
Spine2D's atlas ...