rube vs json file

General discussion about the R.U.B.E editor
Post Reply
kyle.bong2@gmail.com
Posts: 41
Joined: Thu May 29, 2014 5:01 am

rube vs json file

Post by kyle.bong2@gmail.com »

Whats the diff between rube and json file? why not just have one?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: rube vs json file

Post by iforce2d »

.rube files contain information you need to edit the scene, and exported .json files contain information needed by your game to load and run it.

1. Polygon fixtures are stored as the original point list in .rube, allowing you to switch between polygon, line, loop anytime. But in exported .json they are converted to decomposed polygons that Box2D can use (convex, max 8 vertices, ccw winding).
2. Image paths in the exported .json can be given a different base path.
3. You can exclude specific properties from a .json file if you don't need them.
4. Exported .json files don't contain the contents of the script panel.
5. Exported .json has options to use human-readable floats, and to make common float values more compact to reduce file size
6. The .rube file also stores extra information used when editing but not in your game (eg. the display names of custom properties, and the list of options for a drop-down list of a custom property, names of the bitplanes for fixture filter category and mask).

There are topics in the built-in help which explain these in more detail. Look under "Exporting scenes" for the subtopics "Difference between saving and exporting" and "Export options".

Related thread:
viewtopic.php?f=7&t=74
Post Reply