Revision of Tiled Map Editor tmx to scnx|nntx|shcx Glue integration toolkit from Fri, 02/17/2012 - 22:27


This is a tool that is designed to integrate directly into the Glue tool which will let you specify Tiled Map Editor files (.tmx) with the "Add Externally Built File" option.

Build your map with Tiled Map Editor:

Simply place the exe somewhere useful to you, and in Glue do the following:

Update your glue to the daily build. Following the instructions outlined here:

1. Click the settings menu, and choose File Build Tools
2. Click "Add new build tool"
3. In the primary arguments:
a. Build Tool: Path to the exe
b. SourceFileType: tmx
c. DestinationFileType: scnx
In the list on the left, you should see: *.tmx -> TmxToScnx.exe -> *.scnx
4. Click ok.
5. Repeat the process for nntx and shcx files, using TmxToNntx.exe and TmxToShcx.exe.

The tool is now integrated into Glue. In order to use it, follow these steps:
1. In any scene, right click on "files"
2. Select Add Externally Built File
3. Select the .tmx file

Glue will automatically run the tmx file through the build tool, and generate a .scnx, .nntx, or .shcx file in your Glue project based on your dialog selection. All changes to the .tmx file will now automatically trigger updates to the file as long as Glue is open.

Node Networks:

  • One NodeNetwork is generated for the entire tmx file
  • One node per tile is generated
  • Nodes are interlinked within each layer. i.e. One tile layer's nodes do not connect to other tile layer's
  • Add an object layer with " nonodes" (no quotes) at the end of the name to specify where NOT to draw nodes

For fun, try having GlueView open to the scene while you update the tmx file using Tiled Map Editor. GlueView should automatically render the new changes.

You can grab the source code for this tool here:
In either repository or zip form.

You may find it necessary to add this line to your Game's Initialization to avoid black lines:
FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;

You must use zlib or gzip compression (tiled map editor defaults to zlib) to use this tool. Base64 encoding (no compression) also works, but straight XML will not. This is a setting in Tiled Map Editor preferences, and if you haven't changed it, chances are that it will work just fine for you.

Product File: 
Syndicate content