Hi! I am creating a simple drawing tool.
I hope the user can intuitively know the size of the drawing tool through the cursor. However, the way I use is obscured by the picture in which the cursor is drawn. Is not there a good way?
///////////////////////////////////////////////
PGraphics cursor;
PGraphics draw;
int i = 20;
void setup() {
size(900, 600);
cursor = createGraphics(900, 600);
draw = createGraphics(900, 600);
}
void draw() {
if (mousePressed==true) {
draw.noSmooth();
draw.beginDraw();
draw.ellipse(mouseX, mouseY, i, i);
draw.endDraw();
}
cursor.noSmooth();
cursor.beginDraw();
cursor.background(0);
cursor.ellipse(mouseX, mouseY, i, i);
cursor.endDraw();
image(cursor, 0, 0);
image(draw, 0, 0);
}
void mouseDragged() {
cursor(HAND);
}
void mouseReleased() {
cursor(ARROW);
}
void keyPressed()
{
if (keyCode == 107) {
i ++;
}
if (keyCode == 109) {
i --;
}
}