Converting 2D tilemap:
Into 3D mesh:
- Copy ‘mtool.lua’ module to your project.
- Create a standard tilemap.
- Add to scene a game object with a mesh component. Setup it the same texture as tilemap is using. We will use this mesh as target later.
- In your code require mtool: local mtool = require "src.mtool"
- Configure the options table. (see example.script)
- Create a mesh from tilemap:
self.grid = mtool.create_mesh_from_tilemap(meshurl, options)
- Hide origin tilemap.
msg.post(options.tilemap, "disable")
Mtool also contains utility methods for:
- coloring quads by tile coordinates.
- converting world to tilemap coordinates.