Skip to main content

Preloading Assets

Textures, sounds, and other assets can be preloaded by defining a preload.ts file in the root of your project

export default definePreload({
textures: ["res://assets/a.png"],
// ... sounds, etc
custom: async () => {
// custom preloading goes here
},
});

Importing npm Libraries

You can import external npm packages in your scripts by using the npm: prefix before the package name:

import nipplejs from "npm:nipplejs";

This works with any npm package and allows you to use external libraries in your Dreamlab project. The package will be automatically fetched and loaded when your script runs.