Hi, I have a little project and i am trying to change the normal cursor with an image and it works for a little while, however after 1 minute it stops working (the cursor just changes back to the arrow and won’t change anymore).
Here is the code:
void mus(){
if(mouseX<=grid[1][1].moveMINX && mouseY<=grid[1][1].moveMINY){ // upper left
cursor(venstreop,0,0);
}else if(mouseX<=grid[1][1].moveMINX && mouseY>grid[1][1].moveMINY && mouseY<grid[1][1].moveMAXY){ // left
cursor(venstre,0,venstre.height/2);
}else if(mouseX<=grid[1][1].moveMINX && grid[1][1].moveMAXY<=mouseY){ // lower left
cursor(venstrened,0,venstrened.height);
}else if(grid[1][1].moveMINX<mouseX && grid[1][1].moveMAXY<=mouseY && mouseX<grid[1][1].moveMAXX){// down
cursor(ned,ned.width/2,ned.height-2);
}else if (grid[1][1].moveMAXX<=mouseX && grid[1][1].moveMAXY<=mouseY){ // lower right
cursor(hojrened,hojrened.width,hojrened.height);
}else if (grid[1][1].moveMAXX<=mouseX && grid[1][1].moveMINY<mouseY && mouseY<grid[1][1].moveMAXY){ // right
cursor(hojre,hojre.width,hojre.height/2);
}else if (grid[1][1].moveMAXX<=mouseX && mouseY<=grid[1][1].moveMINY){ // upper right
cursor(hojreop,hojreop.width,0);
}else if (grid[1][1].moveMINX<mouseX && mouseX<grid[1][1].moveMAXX && mouseY<=grid[1][1].moveMINY){ //up
cursor(op,(op.width)/2, 0);
}else { //midten
cursor(CROSS);
}
}