Export options



The export options for a scene can be found in the Scene settings dialog, which is opened from under Scene in the main menu. This topic will look at the available settings in that dialog.


Use indentation and newlines for readability
If this checkbox is checked, the output JSON will be in 'pretty' format that is easy for humans to read:

This format results in a file that takes up more space than really necessary. You can uncheck this option to produce a file that is more compact:


Save full path for images
If this checkbox is checked, the 'file' property of images will be saved as their absolute path:

Unchecking this option will cause the path to be relative to either the original .rube file or the exported raw info .json file (depending on whether 'Save image paths relative to original file' is checked or not). Note that this can result in paths with '..' in them to access parent directories.

Both absolute and relative path methods have their advantages and drawbacks. Absolute paths can let scenes use a common set of images (for example a folder on a network share), but this is usually not the path you will use in the final game. Relative paths can make it easier to keep all the files for a scene together and move them to different locations on disk without needing to change the paths inside the RUBE scene, but requires keeping the scene file and the image files in the same places relative to each other, which may be inconvenient when working in a team or using source code control repository systems.

To address this, the 'Specify path' subsection of this option allows you to specify the base path from which relative paths will be generated. As an example, suppose you keep all your images in the folder:
/projects/mygame/images
... and the RUBE scene files are kept in:
/projects/mygame/levels
Now suppose that in your final deployed game you want to keep the level files (exported .json scenes) and images all together in the same folder, and the platform you will be deploying to does not allow using the '..' path to access parent folders (eg. iPhone app bundles).

Now let's say you have an image in your scene called 'cat.png'. Exporting using absolute paths would result in:
/projects/mygame/images/cat.png
which not work in the final game. Exporting using relative paths would result in:
../images/cat.png
which would also not work in the final game. But if you set the "Specify path" option to /projects/mygame/images, then the image path will be exported as simply:
cat.png
which will be found OK in the final deployed game when the scene file and image are side by side in the same folder.

Use human-readable floats in JSON
If this checkbox is checked, floating-point values in the output JSON will be in decimal notation format that is easy for humans to read, which can be handy if you want to edit the files by hand:

When this option is not checked, floating-point numbers will be saved as a hexadecimal representation of the 4 bytes that make up the value. The advantage of this is that values are preserved exactly, and in most cases it also results in smaller file size. Currently only the C++ version of the sample loader is able to parse this type of value.



Compact common floats
If this checkbox is checked, floating-point values between -10 and 10 inclusive that are very close to multiples of 0.01 will be rounded to that multiple to reduce the file size. The most common example of this is the default value of 0.2 for friction of fixtures - due to how floating point values are stored this becomes a rather longer value when output as a human-readable float:

Exporting with 'Compact common floats' checked will cause this to be rounded to 0.2 :



Properties to include in exported JSON files
You can expand the branches of the tree view here to choose which properties are exported. By default all properties are exported, so you can uncheck those that you don't need.

Unchecking properties in this list will cause that property to be excluded from export for all items. For more control over exporting properties for individual items, you can use a property filter export script.


Property export filter script
Please see the Filtering exported items and properties topic for details on how to decide which properties should be exported for individual items.