Loading and saving part 2
More progress on loading and saving today. I had one more aspect that was bugging me. You could save a zip file, but it would always save it as "download.zip". That's not super great, especially if you have lots of different games you want to release, or deal with. So, I remembered there's a "download" attribute on anchors which let you download whatever the link href connects to, specifying it's name. So now I have it set up where if you download your game, it'll generate a link dynamically with the data in the href as a data: url with the download attribute set to the file name of your choice. It's pretty dang cool when you see it in action.
Here's a simple demo: https://ibrpg-testing.glitch.me/test/zip/saveload.html -- to try this out, type some text in the big textbox. Don't paste war and peace in there or you will freeze your browser. Next, type a name for your zip file and hit save the file.
You should see a link appear that says "click here to download".
Click the link - see the file download.
Now, if you want to get the text back, click "choose files". Choose the zip file you just created. Hit open or whatever.
It will then "upload" the zip file, parse the contents, get the txt file and display it's contents in the div. AMAZING right?
IttyBittyRPG
A simple way to create classic RPGs for the web
Status | Prototype |
Author | triptych |
Genre | Role Playing |
Tags | 32bit, Game engine, html, javascript, Simple, storytelling, webgame |
Languages | English |
More posts
- Moving to GodotOct 21, 2018
- Almost to game content with tilemap add onSep 03, 2018
- Lots of progress on properties, favicon, room labels, splash screen and more!Sep 02, 2018
- Latest playable alpha upSep 01, 2018
- Getting property windows to workSep 01, 2018
- Lots of progressAug 26, 2018
- ES6 Web Components and an Alpha previewJun 08, 2018
- ES6 Web Components and an Alpha previewJun 08, 2018
- Library switch and emojisMay 26, 2018
Leave a comment
Log in with itch.io to leave a comment.