Hi all, i have a problem with button and modal…
i have an image with setInteractive and is a Button…
i have another button for open a group and i have create a modal…
but when the modal is open the button in background is tappable…
if the modal is open the button must not work
Any suggestion?
this the code for modal:
import BaseButton from './BaseButton';
class InstructionsPopup extends Phaser.GameObjects.Container {
constructor(config, x, y) {
super(config.scene, 30, 30);
let popupGroup= config.scene.add.group();
let popupBackground = config.scene.add.image(30,30,“popupBackground”).setOrigin(0).setScale(0.5);
let text1 = config.scene.add.text(30, 30, “CIAOCIAOCISDXBUF3QORWSDIFOH”, { font: ‘16px Arial’, fill: ‘#000000’ });
let closeButton = new BaseButton({
scene: config.scene,
callBack: () => {
popupGroup.clear(true);
closeButton.onClear();
}
}, 400,100, false, null, { active: ‘closeButton’, inactive: null, overActive: null, overInactive: null},
{width: 50, height: 50},null, null);
popupGroup.add(text1);
popupGroup.add(popupBackground);
popupGroup.add(closeButton);
}
}
export default InstructionsPopup;