Storage
The storage module allows to store data persistently and retrieve values at a later time. This data is stored in the context of your project. Attaching the same script to a different project will mean reading and writing to a different store. Furthermore the storage is local on your machine. This means it is great for savegames, but not so great for storing a highscore table that other players should also see.
Usage
To use this module, add the following require at the top of your script:
Reference
get
Retrieve a value from storage. The function will not directly return the value but the value is fetched from storage asynchronously and an event is generated once the value is available. See examples.
Parameters
key(string): the key to retrieve
set
Set a value in storage
Parameters
key(string): the key to write tovalue(any): the value to write
remove
Remove a value from storage
Parameters
key(string): the key to remove
clear
Clear the storage
keys
Retrieve all keys from storage. The function will not directly return the values but the data is fetched from storage asynchronously and an event is generated once the data is available. See examples.