idk how to load the svg file. When i try i get a “Access to Image at ‘’ from origin ‘null’ has been blocked by CORS policy: Invalid response. Origin ‘null’ is therefore not allowed access.”
If svg filetypes aren’t supported can someone at least tell me where I can convert the file into a gif or sequence of png’s (and use that to make a loading icon)? Here is the svg loader im trying to use.
var img;
var loadicon;
var loading = true;
function doneLoading(){
loading = false;
}
function setup(){
var cnv = createCanvas(windowWidth, windowHeight);
cnv.style('display', 'block');
cnv.class('cnv');
noStroke();
//have to use link to load image not a local file
img = loadImage('https://raw.githubusercontent.com/petercpark/Mindless-Rubik-s-Cube-Solution/master/rubikscube.png', doneLoading);
loadicon = loadImage('loading.svg');
}
function draw(){
if(loading){
image(loadicon, width/2, height/2);
}
else {
//stuff that i run
}
}
Yes it does but I wanted it to also run in Chrome so I changed the svg into a gif somehow and put it on a Github repository and used the link of the gif image from Github to host the image file and load it into my site.