We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have been working on a project which involved changing the cursor with the cursor() command. I switched to processing 3, and now this command doesn't work at all.
PImage cursor;
void setup(){
size(200, 200, P2D);
cursor = loadImage("Cursor.png");
image(cursor, 0, 0);
cursor(cursor);
}
This creates a screen with the image properly loaded in the top left corner as it should, but it does not change the cursor. It seem that this command is no longer supported, is there an equivalent way to do this in the new version or a way to make this work?
Answers
You could try to turn off the normal mouse cursor using noCursor() and then make the image's location at mouseX and mouseY.
https://github.com/processing/processing/issues/3769
can you test?
It doesn't seem to work in draw().
Sometimes, in a larger piece of code I get an red message "Cursor types no longer supported in OpenGL, please provide your cursor image" I am providing the image, so I don't know why I am getting this. The code sometimes prints (not in red) "Disposing of texture resource" Repeatedly
Neither of these occur dependably.
I made this work using noCursor and drawing an image at that position. It is interesting to me that the cursor(img) command is still in processing when it doesn't do anything.
According to the source code comments cursor() methid is not implemented for P2D & P3D. I assume it will be at some time in the future.
I think this is fixed with the latest version of Processing. It certainly fixed this issue