0
\$\begingroup\$

I'm using sprites made up of very few pixels. When scaling the sprite gets blurry, so how do I disable this smoothing? I couldn't find anything in the docs or elsewhere online

Sprite:

sprite

In pyglet, scaled 8: in pyglet

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Found a solution at Scaling window contents in Pyglet?

from pyglet.gl import *

then add

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) 
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)

to on_draw()

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .