Mobile touch pointers

Hi!
I have flicked through a documentation, labs examples and couple of topics at the old forum, but nothing found.
I want to make 4 mobile touch pointers(left-right, top-down) however there was no possibility to add a specific image to background for the pointer. How am I supposed to do it?
Also, to make it clear - can I just redefine camera field of the pointer and set it to the main one(cause it follows the player and i, apparently, want pointers to follow it either)

It’s not entirely clear from your question, but are you referring to creating buttons (for left, right, up, and down) to control a game object?

Yes, I want to create a touch buttons for mobile.

won’t just creating 4 images and setInteractive() and assign a callback function when they get pressed work? As for the follow camera I think this is totally doable and should be an example.

yes, I tried it already, but callback was not invoked by pressing on image.
I mean, if we are talking about creating image, then there is no problem to make it follows the player, however I am not sure about pointers.

Have you called

scene.input.addPointer(3);

to enable 3+1 touch pointers?

Reference: phaser3 lab, line 22.

Thanks! Yes, that was a mistake too. But the main one is such a shame. I had a function, that i passed as a callback and, in this function, i used the first argument as a link to the scene scope, however i did not pass it there.
It looked like that:
export default function createPointers(game) {
image.on("pointerdown", moveLeft, game);
}
function moveLeft(game) {
game.add.image(9 * 40, 39 * 40, "battery_indicator").setOrigin(0);
}
Thanks to everyone for your replies! So the solution might be creating function, that returns function:
image.on("pointerdown", () =moveLeft(game));
but this doesn’t seem to be correct.
Now it looks this way:
export default function createPointers(game) {
image.on("pointerdown", moveLeft, game);
}
function moveLeft(game) {
this.add.image(9 * 40, 39 * 40, "battery_indicator").setOrigin(0);
}
There was an exception on touching, but I did not inspect my phone via usb(what i should have done of course)ave done of course)

1 Like