Games TILED: adding tile pattern layer

developer_123

Active Member
Licensed User
Longtime User
I'm trying to add a layer with a pattern set to my Mosaic, but I'm having trouble. I've already created a new layer (Tile Layer 3) and added a new set of patterns (pyramids). I fill the mosaic with the newly created set but when executing the patterns do not appear (in my particular case the pyramids). I think I'm missing some simple step. I attach what happened in the link below with the Mario example.

https://wetransfer.com/downloads/06...4ca0671cbc0f63db1daf3d9820220222052129/f5f3e7
 

ilan

Expert
Licensed User
Longtime User
in the Tick event you are drawing only Tile Layer 1 & 2, you need to draw also Tile Layer 3!

B4X:
Public Sub Tick (GS As X2GameStep)
    mMario.Tick(GS) 'run first as mario updates the world position
    TileMap.DrawScreen(Array("Tile Layer 3","Tile Layer 1", "Tile Layer 2"), GS.DrawingTasks)
End Sub

Note that i put Tile Layer 3 in the first position because it is a background and should be drawn first.
But if you ask me i would not draw the background using Tiled. it does not make much sense to use tiled to draw backgrounds.
 

developer_123

Active Member
Licensed User
Longtime User
Thank you Ilan for your answer! I'm loading backgrounds from Tiled as I want to add some subtle sprites to it, to get an animated background feel.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…