Using custom assets - Zariep-Software/WiPersona GitHub Wiki
Using Custom Assets
Most likely, you want to use custom assets instead of the default ones. There are two ways to do this:
Non-local Version
If you're running WiPersona in a non-local mode (e.g., itch.io or GitHub pages), you will need to load your assets on first-time run, the assets will be saved locally using IndexedDB. The data is stored locally, WiPersona cannot, and even if it could, wouldn't want to save your images.
After importing the images on the first run, if you open WiPersona afterwards, it will remember and load the images thanks to IndexedDB. If you want to update an image, simply import another one.
Local Version
If you're running WiPersona locally, you can follow the same steps as for the non-local version. Additionally, you can import in the next way:
- Inside the program's folder, navigate to
data/res/
. There, you will find five files (background.webp
,scream.webp
,silence.webp
,speak.webp
,sourcelist.js
). You can editsourcelist.js
and declare custom assets.
// If you're running WiPersona locally, you can declare the resources here.
// Note that the root path of the page is where index.html is located.
// For example, this file would be in res/sourcelist.js.
// WiPersona allows any image type supported by your browser (e.g., WebP, GIF, PNG ).
export const Background = "res/background.webp";
export const AvatarSpeak = "res/speak.webp";
export const AvatarSilence = "res/silence.webp";
export const AvatarScream = "res/scream.webp";
The only requirement is that the files needs to be Image type, WiPersona works correctly with animated images (e.g., WebP, GIF, AVIF ).