Here is my code
var canvas;
let dirtImg;
function preload() {
dirtImg = loadImage('assets/blocks/dirt.png');
}
function setup() {
// put setup code here
canvas = createCanvas(window.innerWidth, window.innerHeight, WEBGL);
}
function draw() {
// put drawing code here
background(100);
strokeWeight(1);
//fill(50);
push();
translate(100, 100);
//rotateY(1.25);
//rotateX(-0.9);
texture(dirtImg);
box(100);
pop();
}
window.onresize = function() {
var w = window.innerWidth;
var h = window.innerHeight;
canvas.size(w,h);
width = w;
height = h;
};
Im using Google’s Firebase as the sever however the image “assets/blocks/dirt.png” is not being loaded on to the cube / box . How do I fix it?