Need some help with tilemap

Hello there.

I am a beginner and having a issue.

I made a scene and added the tilemap and layers
Then I added this plugin https://rexrainbow.github.io/phaser3-rex-notes/docs/site/virtualjoystick/

But looks like the joystick is behind the tileset, how do I change it?(screenshot below)

Thank you so much for helping.

I guess you only have to instantiate the :joystick: after the tiles.

Try to put the code for the joystick at the bottom of create()

1 Like

Thank you so much!
Works like a charm!

Hello @matrizet
I know you found your solution for this but there is also setDepth() method. You can change the order with this.

For Example:

create() {

// INFO: Background image
this.add.image(this.centerX, this.centerY, 'bg1').setDepth(-1);

// setDepth(99) for me "i want my particles on top of my screen"
this.particles = this.add.particles('agent4').setDepth(99);
this.particles.createEmitter(this.cache.json.get('explode'));

// INFO: Sağ alttaki örümcek ağı
this.add.image(1920, 1080, 'spider').setOrigin(1).setDepth(10).setAlpha(.4);

}

It’s changing the rendering order on list. So Even if i add my spider after my particles, my particles are rendering on top of spider :slight_smile:

1 Like

Oh, thanks but how does setDepth work?

As far as i know, all GameObjects have this setDepth method and it’s changing the rendering order as i said before.

You can check the phaser3-examples-depth-sorting :slight_smile:

Also @prob mentioned the original source code of Depth :slight_smile:

1 Like

Ok thank you very much.
And sorry for wasting your time :slight_smile:

That wasn’t a waste believe me just try to check phaser-docs and also check on phaser3-examples what ever you need first. You mostly find what you need :slight_smile:

1 Like

I tried the phaser Docs but couldn’t understand a thing.
And examples takes a long time to load so I just scrape the web for answers.
Anyways thanks for the concern

I see :slight_smile:

Another suggestion about examples is that you can clone the github repo phaser3-examples and use it from ur local machine. Dont forget to git pull time to time :slight_smile:

1 Like

Thanks very much, Ive downloaded the examples. It sure took a lot of time.
Thanks once again :smile: