Loader for audio. Assets will be loaded as Howler.js Howl instances
Loader for audio. Assets will be loaded as Howler.js `Howl` instances
Loader for data files (JSON, EDN). Parses content as Clojure data structures.
Options: :keywordize-keys - Convert string keys to keywords (default: true)
Loader for data files (JSON, EDN). Parses content as Clojure data structures. Options: :keywordize-keys - Convert string keys to keywords (default: true)
Loader for three-troika-text fonts. Should be used to pre-load font files
Loader for `three-troika-text` fonts. Should be used to pre-load font files
(load! asset-database asset-tree)Loads the assets defined in the asset-tree into the asset-database atom.
Returns a Promise:
asset-databaseLoads the assets defined in the `asset-tree` into the `asset-database` atom. Returns a Promise: * on success: all assets have been loaded into the `asset-database` * on failure: one or more assets have failed to load. See the console for error messages
(load-zip! asset-database zip-url asset-tree)(load-zip! asset-database zip-url asset-tree {:keys [base-path]})Loads assets from a zip file into the asset-database atom.
The zip file is downloaded, extracted to memory, and assets are loaded from the extracted files using ObjectURLs.
Options: :base-path - Path prefix inside the zip to strip. Use this if the zip has a root folder (e.g. if zip contains assets/models/foo.glb and your tree references models/foo.glb, set base-path to "assets")
Returns a Promise:
asset-databaseExample: (load-zip! db "./assets.zip" [["models" {:loader model-loader} ["alien.glb" :model/alien {}]] ["textures" {:loader texture-loader} ["tile.png" :texture/tile {}]]])
Loads assets from a zip file into the `asset-database` atom.
The zip file is downloaded, extracted to memory, and assets are loaded
from the extracted files using ObjectURLs.
Options:
:base-path - Path prefix inside the zip to strip. Use this if the zip
has a root folder (e.g. if zip contains assets/models/foo.glb
and your tree references models/foo.glb, set base-path to "assets")
Returns a Promise:
* on success: all assets have been loaded into the `asset-database`
* on failure: one or more assets have failed to load. See the console for error messages
Example:
(load-zip! db "./assets.zip"
[["models" {:loader model-loader}
["alien.glb" :model/alien {}]]
["textures" {:loader texture-loader}
["tile.png" :texture/tile {}]]])Loader for 3D models. Currently supports GLTF, GLB and FBX files.
Loader for 3D models. Currently supports GLTF, GLB and FBX files.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |