D developer_123 Active Member Licensed User Longtime User Nov 21, 2020 #1 Good day. I'm trying to configure the map of my game with the images of the floor, walls, trees, etc., but I can't find the way it works. The first place I am following the example of Mario, in Tiled, creating a set of patterns which is previously dimensioned to the desired pixels. In the TILED program, I look for the .png file and select the option to embed in the map. Then I select layer number 1 (I only have one layer of the type Tiled), and I draw my stage and save it. Inside B4X (my application is multiplatform), I load the map like this: B4X: Copy TileMap.Initialize(X2, File.DirAssets, "map.json", Panel) TileMap.SetSingleTileDimensionsInMeters(WorldWidth / TileMap.TilesPerRow, WorldHeight / TileMap.TilesPerColumn) TileMap.PrepareObjectsDef(ObjectLayer) In the main Tick I introduce the following code: B4X: Copy TileMap.DrawScreen(Array("Tile Layer 1"), GS.DrawingTasks) but it does not load the image. I have tried everything, I have followed Mario's example step by step but the image of my set of patterns does not load, I can see my characters walking, but the image of the set of patterns does not. I may be overlooking something. I appreciate any clue that can guide me.
Good day. I'm trying to configure the map of my game with the images of the floor, walls, trees, etc., but I can't find the way it works. The first place I am following the example of Mario, in Tiled, creating a set of patterns which is previously dimensioned to the desired pixels. In the TILED program, I look for the .png file and select the option to embed in the map. Then I select layer number 1 (I only have one layer of the type Tiled), and I draw my stage and save it. Inside B4X (my application is multiplatform), I load the map like this: B4X: Copy TileMap.Initialize(X2, File.DirAssets, "map.json", Panel) TileMap.SetSingleTileDimensionsInMeters(WorldWidth / TileMap.TilesPerRow, WorldHeight / TileMap.TilesPerColumn) TileMap.PrepareObjectsDef(ObjectLayer) In the main Tick I introduce the following code: B4X: Copy TileMap.DrawScreen(Array("Tile Layer 1"), GS.DrawingTasks) but it does not load the image. I have tried everything, I have followed Mario's example step by step but the image of my set of patterns does not load, I can see my characters walking, but the image of the set of patterns does not. I may be overlooking something. I appreciate any clue that can guide me.
Erel B4X founder Staff member Licensed User Longtime User Nov 22, 2020 #2 Can you upload the project?