Raptor RichJson Format - coldrockgames/gml-raptor GitHub Wiki
The so called RichJson Format
acts as an extension to the standard Json Format and brings many new commands and allows you to have struct inheritance!
Struct Inheritance
{
"A": {
"memberA": "content"
},
"B": {
"inner_struct": {
"memberB": "content"
}
},
"C::A, #global:my_global_struct/G, B/inner_struct": {
"memberC": "content"
}
}
Note the ::
in the key of "C::A, #global:my_global_struct/G, B/inner_struct"
, this character is interpreted as an inheritance character, everything after ::
is interpreted as a reference. In this case we have three references A
, B/inner_struct
and a global variable my_global_struct/G
.
{
"A": {
"memberA": "content"
},
"B": {
"inner_struct": {
"memberB": "content"
}
},
"C": {
"memberA": "content",
"memberB": "content",
"memberC": "content",
"memberG": "content" // <-- member is from my_global_struct/G
}
}
Commands
#folder
"member": "#folder:game_files/settings"
Loads a folder into this member, like "#folder:game_files/settings".
#file
"member": "#file:game_files/mycontent.json"
Loads a file into this member, like "#file:game_files/mycontent.json".
#global
"member": "#global:game_settings/controller_settings"
References a global variable, like "#global:game_settings/controller_settings".
#join
"member": "#join:A, B"
A comma-separated list of elements in the same file (refs) that is going to be joined together.
#ref
"member": "#ref:global/strings/hello"
References another key in the same file, like "#ref:global/strings/hello".
#asset
"member": "#asset:sprBackgroundForest"
References an ingame asset, like "#asset:sprBackgroundForest".
#rgb
"member": "#rgb:FF0000"
Makes a rgb color given in hex- or numberic format, like "#rgb:FF0000" or "#rgb:255, 0, 0".
#bgr
"member": "#bgr:0000FF"
Makes a bgr color given in hex- or numberic format, like "#bgr:0000FF" or "#bgr:0, 0, 255".
#hsv
"member": "#hsv:0, 255, 255"
Makes a hsv color given in numberic format, like "#hsv:0, 255, 255".
#color
"member": "#color:c_red"
References a scribble color, like "#color:c_red".