-
When compiling the project for wasm, the filesystem is not available, since we're running in a browser. So how do you load assets? What are the best practices? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The most common approach is to use the https://pkg.go.dev/embed package in order to embed the assets directly into the compiled executable / wasm file. Most entries in the 2022 Ebitengine game jam did that. If you have many assets, though, yes, you would need to use http requests, but that's rarely necessary. Like, if you need to do that, you should be at a level where you can figure it out on your own. |
Beta Was this translation helpful? Give feedback.
The most common approach is to use the https://pkg.go.dev/embed package in order to embed the assets directly into the compiled executable / wasm file. Most entries in the 2022 Ebitengine game jam did that. If you have many assets, though, yes, you would need to use http requests, but that's rarely necessary. Like, if you need to do that, you should be at a level where you can figure it out on your own.