-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loading local files like json #106
Comments
if you are using Phonegap, it loads local files using it's own web server, so it should be able to load the files without problem. What are you using to wrap the game on mobile? |
You can't load JSON files via AJAX from a file:// URL... You can easily turn your json file into a .js file with a Quintus module. Quintus.MyData = function(Q) { Then include that module in your setup. |
Sorry Cykod, but this solution seemed unserious (to insert json data hardcoded in js file). I have developed a little function to load local files. Now I can execute fine the samples using local assets. You could append a similar utility in the Quintus to facilitate the local games. //Q.load("sprites.png, sprites.json, level.json, tiles.png, background-wall.png", function() { |
This won't work for everyone and on every browser. For security reasons JavaScript's access to the file system on the client is restricted - consider whether you would want (somebody else's) JavaScript to read your sensitive documents. Someone can disable that "security feature" in his browser manually. For instance, for Google Chrome you have to startup the executable with |
@fraespre - are you trolling? That's exactly what the current system does: See @jerone's comment about security. |
@cykod , I was interested and downloaded the latest version of Quintus to Local. I probed the different examples and I found most samples crashed when load json files. [ Win 7 &Firefox 28.0 ] > uncaught exception: Error Loading: sprites.json ... Do you think this is the troll behaviour? |
Hi,
I think it's very important than we can load local resources like the json files. This is significant if you want make a local game to run in a mobile.
I don't know what is exactly the problem, I suspect this is a safety restriction. But another JS game engine (similar to quintus) can load this type of files:
https://github.com/Galloman/ss2d
I suggest than you can investigate how can resolve the problem watching the ss2d source code (ResourceManager.loadResources).
regards,
The text was updated successfully, but these errors were encountered: