sciter-sdk/rust-sciter

Could provide example to load resource files(html, icon, css, js) from disk?

taodongl opened this issue · 2 comments

take "minimal" as an example: <html window-icon="icon.png"> doesn't work, because "icon.png" isn't found in memory
Could give an example to load files from disk. It is helpful to hot-reload

Oh right, it will not be loaded because the URL we use is a virtual one: example://minimal.htm.
So, it should be either a file path or all resources should be packed to a single resource package (for example, archived.rs). Or via a custom resource loader.

Regarding the hot reload - it can also be done via a script itself: c-smile/sciter-sdk#164.

Could provide example to load resource files(icon, css, js) which doesn't rely on "packfolder.exe"?

Well, besides packfolder there could also be:

  • file path
  • zip archive
  • custom resource loader

For live reloading (or in debug (edit-and-reload) environment) file paths are better, for sure.