encode

fun encode(entities: List<DrawableEntity>, pretty: Boolean = false): String

The JSON for entities, in their order. pretty adds line breaks and indentation, for a person to read; the content is the same.

Throws

if two shapes have the same id, or two different pictures share a key (a key names one picture).