GameMaker Studio 2 (2.3)
Icon

JSON Struct

FrostyCat

You must be logged in to obtain assets

Description

Overview

JSON Struct is a complete, cleanup-free replacement for GMS 2's built-in JSON functions. Encode and decode JSON as native structs and arrays, load and save them in one take, and even encrypt them!

Features

  • Complete coverage of the JSON standard: Structs, arrays, numbers, strings, booleans, nulls
  • ZERO manual cleanup: No more ds_map_destroy()!
  • ZERO manual type marking: No more ds_map_add_*() or ds_list_mark_as*() for nested entries!
  • One-line utilities for loading and saving data
  • Encrypt data with ease using the built-in RC4 implementation or another algorithm of your choice

Documentation

See the Wiki section on the official GitHub repository.

Examples

Saving JSON data:

jsons_save("example.json", {
    messages: ["Hello World!", "Goodbye World!"]
});

Loading JSON data:

global.messages = jsons_load("example.json");

Decoding JSON strings:

var json_str = @'{"messages":["Hello World!", "Goodbye World!"]}';
//...
var json_data = jsons_decode(json_str);
show_message(json_data.messages[0]); //Hello World!

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS2.3 - Version 1.0.0. Published September 20, 2020

Initial release.

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait

Back to Top