Im fairly new to processing. Im using PGraphics to try a simple paint program.
but I want my program to be primitive looking ( low resolution ), I’ve managed to get it in fullscreen with a custom low-res resolution, but my strokes look weird and outlined. I really just want a sharp, pixelated look. I haven’t been able to find any resources for creating a pixelated look.
heres my code: ( note please change the variables displayW && displayH to your correct screen resolution)
PGraphics layer0;
int pgWidth = 128;
int pgHeight = 72;
float displayW=2560;
float displayH=1600;
color var_brushColor = color(255, 255, 0);
int mousePress=0;
void setup()
{
fullScreen(P2D, 1);
background(255, 255, 255);
layer0 = createGraphics(pgWidth, pgHeight);//, P2D);
}
void draw() {
// quick test to change colors
if (keyPressed)
{
if (key == 'Q' || key == 'q')
{
var_brushColor= color(255, 0, 0);
}
if (key == 'W' || key == 'w')
{
var_brushColor= color(0, 255, 0);
}
}
// custom mouse variables
float mouse_x=((mouseX+mouseX)/(displayW/(pgWidth)));
float mouse_y=((mouseY+mouseY)/(displayH/(pgHeight)));
float pMouse_x=((pmouseX+pmouseX)/(displayW/(pgWidth)));
float pMouse_y=((pmouseY+pmouseY)/(displayH/(pgHeight)));
layer0.beginDraw();
if (mousePress==1)
{
layer0.stroke(var_brushColor);
layer0.strokeWeight(0);
layer0.line(mouse_x, mouse_y, pMouse_x, pMouse_y);
}
layer0.endDraw();
image(layer0, 0, 0, width, height);
}
void mouseDragged()
{
mousePress=1;
}
void mouseReleased() {
mousePress=0;
}