Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving and loading files in HTML5 with LibGDX

I was looking at the "wiki" for LibGDX and I don't see a method to save or load when using HTML5. Could anyone point me in the right direction on how I can go about saving and loading files in HTML5 via LibGDX?

I know it is possible with HTML5 just not sure how to do it through LibGDX.


1 Answers

The File handling wiki says, that on HTML5 only Gdx.Files.internal is available.
Gdx.Files.internal is read only, so you can only load data from there.
there is one other possibility: The Preferences.
The wiki says:

Preferences are also the only way to date to write persistent data when your application is run in the browser.

This means, that only this way you can sava and load data.

like image 154
Robert P Avatar answered Jan 29 '26 12:01

Robert P



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!