Everton Cunha
Everton Cunha

Reputation: 21

Change mouse cursor in Processing

How can I change the mouse cursor in Processing to a png with transparency?

Only in the application window.

Upvotes: 0

Views: 7599

Answers (1)

Sérgio Passos Jr.
Sérgio Passos Jr.

Reputation: 347

Try this:

PImage mouseCursor;

void setup() {
  size(640,480);

  mouseCursor = loadImage("MouseCursor.png");
}

void draw() 
{
  if(mouseX < 100) {
    cursor(mouseCursor, 0, 0);
  } else {
    cursor(HAND);
  }
}

Upvotes: 4

Related Questions