2

This is coded in a javascript library called p5.js see: https://p5js.org/reference/

So I set up a basic code to try and get a custom cursor...

var img;

function setup() {
  createCanvas(1000, 650);
  img = loadImage("assets/arrowmouse.png");
  image(img, mouseX, mouseY);
}

function draw() {
  background(20, 155, 255);
  fill(0, 0, 0);
}

No image appears so I'm getting a blue screen (my background)

konekoya
  • 1,995
  • 2
  • 18
  • 30
Coding King2
  • 37
  • 1
  • 9

1 Answers1

1

Solved

Its a google chrome security block. I used firefox and it worked fine.


Solved in a YouTube comment: 7.8: Objects and Images - p5.js Tutorial

had to tweak syntax too it looks like this now:

var img; function preload(){ 
arrowMouse = loadImage("assets/arrowmouse.png"); 
} 
function setup(){ 
createCanvas(1000,650); 
} 
function draw(){ 
background(20,155,255); 
fill(0,0,0); cursor("none"); 
image(arrowMouse, mouseX, mouseY,20,30); 
}

but that wont work in chrome.

This also may help: Disable same origin policy in Chrome

Thanks to all that tried to help!

NewToJS
  • 2,664
  • 3
  • 12
  • 22
Coding King2
  • 37
  • 1
  • 9
  • 1
    Could you explain more about this Chrome security block? This might help others in future who are experiencing the same or similar problem. – NewToJS Apr 30 '18 at 01:41
  • solved in a youtube comment of a comment https://www.youtube.com/watch?v=FVYGyaxG4To look for the comment from Márk Molnár – Coding King2 Apr 30 '18 at 01:43
  • had to tweak syntax too it looks like this now: var img; function preload(){ arrowMouse = loadImage("assets/arrowmouse.png"); } function setup() { createCanvas(1000,650); } function draw() { background(20,155,255); fill(0,0,0); cursor("none"); image(arrowMouse, mouseX, mouseY,20,30); } but that wont work in chrome – Coding King2 Apr 30 '18 at 01:43
  • this also may help? https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome – Coding King2 Apr 30 '18 at 01:46
  • If this is the answer to the question, please mark it as accepted so your answer stop showing up as needing an answer. – Kevin Workman Apr 30 '18 at 16:22
  • Seems like firefox is also blocking this. – krenerd Apr 15 '21 at 01:54