Replies: 3 comments 9 replies
-
What do you mean by "provide the file yourself"? You mean prompt the players with a upload dialog when they run the game? Or bundle the asset with the binary so that there isn't additional network traffic when loading assets? Is this what you want? There is a very good reason that by default on the web bevy fetches assets as URLs. It's because it's much faster for the user, and much more convenient for you as a dev. Make sure to run the wasm file with a web browser. Typically, you'd start a file server (for example with If you want to prompt the player for each asset you use, you could implement your own If you want to bundle the assets, you can use |
Beta Was this translation helpful? Give feedback.
-
sorry, that I did not answer for so long, my collegue and I are still trying to find out a way how to include a java script module in the modules generated by bindgen |
Beta Was this translation helpful? Give feedback.
-
okay we figured out how to reference the modules correctly and we now have a working JS implementation that provides assets.
I have to convert that to a BoxedFuture, however what exactly even is a BoxedFuture? And how do I do that?
but I do not understand it and it is not the correct type |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I compile my code as WASM. I try to load it like that:
let texture = asset_server.load("baer.png");
It works for normal builds, but under WASM, it makes this:
GET http://127.0.0.1:8081/assets/baer.png [HTTP/1.1 404 Not Found 2ms]
So instead of file it goes HTTP GET. But I don't want it to do that, instead I want to provide the file myself. Is that possible?
Either I want to give it a path or binary data to draw from, or another URL
Beta Was this translation helpful? Give feedback.
All reactions