[back to index]

Library Reference (v 0.9.0)

Save

Simple loading and saving of data.
Save.filename:String
Optional! Sets the name of the savefile to that Save.load() and Save.savevalue() will use. By default, the save filename is "haxegongame".
Save.savevalue(key:String, value:?)
Saves a value. Can be loaded later with Save.loadvalue().
Save.loadvalue(key:String)
Loads a value that you've previously saved with Save.savevalue(). If no saved value for that key exists, then it returns 0.
Save.exists(key:String):Bool
Returns true if a value has been saved for this key in the current file, false otherwise.
Save.fileexists(savefile:String):Bool
Returns true if a given save file exists, false otherwise.
Save.delete([filename:String])
Deletes all saved values in a given filename. If no filename is given, deletes all saved values in "haxegongame".
Save.keys
An array of strings, containing all the keys in the current save file.