Hi Phaser community,
Here goes my first post…
I have the following setup inside the constructor of an angular component (ionic project).
let config = {
type: Phaser.AUTO,
width: '100vw',
height: '100vh',
transparent:true,
disableContextMenu: true,
parent: 'phaser-example',
physics: {
default: 'arcade',
arcade: {
gravity: { y: 200 }
}
},
scene: {
preload: function() {
that.preload(this);
},
create: function() {
that.create(this);
},
update: function() {
that.update(this);
}
}
};
this.game = new Phaser.Game(config);
and I set a listener for a click/touch event in the create method as follows:
create(scene){
scene.input.on('pointerup', this.moveSourceSprite, scene);
}
However, the moveSourceSprite is never called. When I listen for pointerupoutside and click on the game, the moveSourceSprite is called however.
I suppose, the scene does not listen the whole game area for some reason.
I am brand new to Phaser and stuck at this point. I’d be grateful if you could help me out.
Thanks,
Doug