Hello,
I’m doing a little game and I’m using pixel art images so I need to use noSmooth() which doesn’t works in P2D…
I would like to know if there is another way to use pixel art in P2D.
Sorry about mistakes, I’m french.
Hello,
I’m doing a little game and I’m using pixel art images so I need to use noSmooth() which doesn’t works in P2D…
I would like to know if there is another way to use pixel art in P2D.
Sorry about mistakes, I’m french.
Hi, are you resizing the image when drawing it?
Can we have a working example to help you with?
Yes i’m resizing images
And here is the game : Flappy Nyan
I think it is due to the resizing. When you work with “pixel art” you don’t want to resize your images because you will end up with blurry lines.
Oh… Okay
So how can i do ?
i found how to do, thanks anyway
Happy to hear that
Can you explain what you did in case other people come here to find an answer to a similar project?
Hi,
I found that this
((PGraphicsOpenGL)g).textureSampling(
3
);
instead of noSmooth(); might help? Haven tried it myself.
Source: noSmooth does not work in P2D / P3D · Issue #5363 · processing/processing · GitHub → https://forum.processing.org/two/discussion/24084/nosmooth-isnt-working-in-p3d → pixel graphics - Processing 2.x and 3.x Forum
I’ll keep this code and try later, thanks
Can confirm now. It works!
PImage img;
void setup() {
size(500, 700, P2D);
//size(500, 700);
img = loadImage("key.png");
//noSmooth();
((PGraphicsOpenGL)g).textureSampling( 3 );
}
void draw() {
background(0);
image(img, 0, 0, 500, 700);
}
^ There is a very small picture to scale up btw.