Relative Content

Tag Archive for pythonpyglet

Pyglet ‘window.set_location()’ method does not work properly

A most weird problem has occurred to me a couple of days ago during my exploration of the pyglet package: While window.set_location(x,y), window centering on the screen etc. were working fine, at a certain point when I wanted to center a pyglet window on the Windows screen as usual, the window was totallly off center. See image below.

Python class attribute with a value of type inherited class

I am making a game in Python with Pyglet and currently I am tring to involve some menu screens or end screens. I made a class called Screen and the screens (for example GameScreen) inherit from it. The Screen class has a class attribute, s, which is the current screen to be displayed. How am I supposed to assign some Screen object to it?

Pyglet – Using Custom Groups to plot multiple objects

Perhaps the way I am structuring my program just doesn’t make sense , but I would like to use a custom group class to easily plot multiple shapes. I create three shapes with the CustomGroup Class and plot them using the same shader program but with different translations.