pygame16-bitflixel

2x2 Pixel Surface in Pygame


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.


Solution

  • 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.