Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to scale a window's contents so that every pixel displays at a multiple of it's normal size. Basically I want to achieve larger pixels without scaling each and every individual sprite. This question is very similar to this one, however that only scales a single sprite. How should I go about this?

share|improve this question
up vote 2 down vote accepted

Ended up figuring out the answer myself through trial and error, solution follows.

You need to import openGL to get access to the scaling function:

from import *

Next, toss in the following code after your game's window has been initialized:

#These arguments are x, y and z respectively. This scales your window.
glScalef(2.0, 2.0, 2.0)

At this point your resolution will double, but your window will stay the same size. You can correct this easily by doubling your window's width and height. Furthermore, your textures will appear blurry, so we need to fix that. We need to set parameters for the textures in your on_draw() function:

def on_draw(self):
        self.clear() #clears the screen
        #The following two lines will change how textures are scaled.
        self.label.draw() #blits the label to the screen

You should now have pixels displaying at double their original size.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.