I’m making a dr trivia game. The problem is that the clickable area has moved. How do I make the clickable area fit the button?
//------------------------ code -----------------------
var array = [230,300,370,440];
var azar = array.sort(() => 0.5 - Math.random());
var pregunta = this.add.dom(400, 130, 'div', Pregun_style, `${Texto["pregunta"]}`);
var btn1 = this.add.dom(400, azar[0],'div', btn_style, `${Texto["respuesta"]}`).setInteractive().on('pointerdown',()=>{});
var btn2 = this.add.dom(400, azar[1],'div', btn_style, `${Texto["incorrecta1"]}`);
var btn3 = this.add.dom(400, azar[2],'div', btn_style, `${Texto["incorrecta2"]}`);
var btn4 = this.add.dom(400, azar[3],'div', btn_style, `${Texto["incorrecta3"]}`);
var container = this.add.container(0,0);
container.add([ pregunta, btn1,btn2,btn3,btn4])
this.input.enableDebug(btn1)
}
```Other than that, how do I make the update function check if the player clicked the correct or incorrect question?
try with
function update(){
bg.tilePositionX -=+1;
bg.tilePositionY -=+1;
if(btn1.activePointer.isDown){
btn1.background = “green”
}}```
But it does not work