Assets
Last updated
Last updated
All of the different types of content that make up your game are called "Assets". Assets can be music, sound effects, textures, cubemaps, GLTF models, images, videos, and more.
All of your assets must be placed in the assets
folder at the root of your project project structure. If you created your project using the HYTOPIA boilerplate or a template, your asset folder will look something like this.
Throughout the HYTOPIA SDK, you'll be required to provide a URI to some type of asset. Whether this be a URI for a model, an audio file, a texture, or something else.
All asset URI's are provided relative to the assets folder.
For example, if we created a new block type that used a texture called dirt.png
and we specified the URI to find that texture as textures/dirt.png
, then the fully resolved path would be assets/textures/dirt.png
It's common to want to organize your assets into subfolders, you can do this in any way you'd like. Again, the only important thing is all your assets must exist as a child of your root assets
folder.
For example, we could create a audio
folder in our assets
folder to hold our .mp3 and .wav sound files for out game. Maybe we want to organize it a bit better and make multiple subfolders for organization so our structure looks like assets/audio/songs
and within the songs
folder we put ambient music. When needing to provide an audio URI for say the Audio class, we'd then use something like audio/songs/my-song.mp3
.