0

I'm trying to develop a 16-bit-era looking game with pygame. I was working with FlashDevelop and Flixel but I wanted to try something more solid. The probleme I'm having is with the look of the game, I want every pixel in screen to be "bigger", I mean, for each pixel in a 320x240 surface I need a 2x2 pixel projection in a 640x480 surface to get the look of games like Frogatto. Asking here and there I found out it's not as easy as it was in Flixel.

Can you guys guide me?

Update

I figured out a way to blit a scaled surface into the main surface as follows

screenSize = width, height = 640, 480
mainScreen = pygame.display.set_mode(screenSize)
smallScreen = pygame.Surface((320, 240))
pygame.transform.scale(smallScreen, screenSize, mainScreen)

If someone could give me some pointers in best practices about this thing, I would appreciate it.

Gama11
  • 31,714
  • 9
  • 78
  • 100
fixmycode
  • 8,220
  • 2
  • 28
  • 43
  • I've never used pygame, but what I would do is render to an image that's 320x240 as normal, then paint that image to the screen as 640x480. – corsiKa Aug 21 '11 at 22:35

2 Answers2

0

Not sure if you're asking for specific advice on pygame or how to upscale 320x240 --> 640x480 pixels...

If the latter, then:

There are a couple of algorithms to upscale pixel art, as used by MAME - search for hq2x, hq3x, hq4x; alternatively have a look at http://en.wikipedia.org/wiki/Hqx or more generally http://en.wikipedia.org/wiki/Pixel_art_scaling_algorithms.

Probably a bit off-topic for what you need, but http://research.microsoft.com/en-us/um/people/kopf/pixelart/index.html shows some really interesting developments in pixel scaling.

rhu
  • 963
  • 5
  • 9
0

If you draw all your various graphics onto a bitmap each frame (like what Flixel does), you can just set the scale of the bitmap to 2.0 instead of the default of 1.

From what I understand of Flixel, the main class only has one child added to the screen, a bitmap. Each flixel object that is shown is drawn each frame to that bitmap. Flixel's scale variable is just the scale of that bitmap.

Mar
  • 7,765
  • 9
  • 48
  • 82