Relative paths won't work as they are not relative to the sketch but to /gui . Use absolute paths using the /projects route. Also, resources need to be loaded in preload():
This works if you have 0.png in the project folde, as long as from C++ you are passing the correct value to gui.setup(), e.g.: gyu.setup(context->projectName);.
let img;
function preload() {
img = loadImage(`/projects/${Bela.control.projectName}/0.png`);
}
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
image(img, width-170, height-70, 120, 50);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}