Frage

So, I'm working on a game using Pyglet for graphics and hardware. The game I am working on requires me to do intensive collision detection using pixels. The game window is created as such:

# Set up buffer variables
bufferedHeight = 256
bufferedWidth = 144

# Create the window
window = pyglet.window.Window(bufferedWidth, bufferedHeight, resizable=True)

I want my game window to increase pixel size accordingly when the window is re-sized. Therefore, the game logic will still think the window is 256 by 145 pixels, however it will display on screen with much larger pixels. How can I go about doing this?

War es hilfreich?

Lösung

From what I understand, you want BIG pixels to be drawn.
I would suggest rendering your pixel buffer to an openGL texture which could be then in turn rendered to screen and scaled each time the 'resize' event happens..
But you must be aware that the square proprtion of the pixels might not be maintained on resize of the window.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top