Using exported data



To export data from R.U.B.E in a format suitable for use in your own program, select 'Export scene' -> 'Save raw info' under 'File' in the main menu. This will output a .json file containing all the information in the scene in a format directly usable in a Box2D world. This format is slightly different from the .rube file format used by the R.U.B.E program itself. See the difference between saving and exporting topic for further explanation.

Exporting the scene to 'raw info' .json requires that your program can load the produced JSON to reproduce the world. Currently there are loader implementations available to do this for the following languages. See the individual topics for details on their usage.

Please see the 'sampleLoaders' folder for an example usage of each of these.


JSON file structure
The exported 'raw info' file is a JSON format file for which parsers are available in many languages (opens default browser). If there is no existing loader for the language you are using Box2D with, you may be able to create one by following the structure contained in the exported file. See this topic for details on the JSON file structure.


Exported properties
The default behavior is to export all properties to JSON. To exclude unnecessary properties and reduce the exported file size, you can specify which individual properties to export in the Export options tab of the Scene settings dialog.


Exporting source code
The scene can also be exported as C++ source code by selecting Export scene -> Save as source code under File in the main menu. This does not provide as much flexibility as exporting to JSON, but it may be useful in some situations where implementing a loader to read the JSON file is not necessary.