Options
All
  • Public
  • Public/Protected
  • All
Menu

Functions to store and load basic values (strings or numbers), organized into objects:

  • Each object has a name
  • Each value can be accessed using a path-like string (for example: Root/Some folder/MyValueName), where each segment is separated by a slash.

These objects are persisted into the environment localStorage - which might not always be available (if not, objects won't be persisted).

Index

Functions

  • clearJSONFile(name: string): any
  • deleteElementFromJSONFile(name: string, elementPath: string): any
  • elementExistsInJSONFile(name: string, elementPath: string): any
  • loadJSONFileFromStorage(name: string): void
  • Load into memory a JSON serialized object, from the local storage provided by the browser/environment.

    The object name is prefixed with GDJS_ in localStorage.

    Parameters

    • name: string

      The name of the object to load

    Returns void

  • unloadJSONFile(name: string): void
  • Unload from memory an object, which is then serialized as JSON and stored in the local storage provided by the browser/environment.

    The object name is prefixed with GDJS_ in localStorage.

    Parameters

    • name: string

      The name of the object to load

    Returns void

  • writeNumberInJSONFile(name: string, elementPath: string, val: any): any
  • writeStringInJSONFile(name: string, elementPath: string, str: any): any

Generated using TypeDoc