[pygame] Re: pygame frontend

Skip to first unread message

Brian Sturk

Nov 23, 2020, 3:29:00 PM11/23/20
to Michael Palmer, pygame...@seul.org
Hi Michael,

Thanks so much for the response, yes I am using 1.9.1.  This is mostly due to still using Python 2.x.  I will look into upgrading and porting to Python 3.x and trying out these suggestions.


On 11/23/2020 12:24 PM, Michael Palmer wrote:
I get the feeling you are using an older version of pygame (1.9.1 or 1.9.6 perhaps). The debug print has been fixed for quite some time. Also, pygame2.0 uses SDL2 and handles fullscreen better. It supports a scaled fullscreen desktop mode that actually changes the desktop resolution. Just use the pygame.SCALED flag to pygame.display.setmode()

To upgrade you can try one of these commands:
pip3 install pygame -U
pip install pygame -U

I think if I were creating a front end like this I would destroy the window before executing a game, and then recreating it afterwards.

The official pygame Discord has recently shut down. Perhaps you might want to visit the github or an unofficial pygame discord.

| Brian Sturk ------- http://www.briansturk.com  ------ | .>   )\,^a__
|-------------------------.  _______ Ethical Hacker ___ |(  _ _)/ /-."~
| --- C/C++/Python/ASM     `----------------------------| `( )_ )/
| Linux/BSD/OSX/Windows embedded/system programming --- |_<_s_<_s

Brian Sturk

Nov 26, 2020, 12:34:29 PM11/26/20
to Michael Palmer, pygame...@seul.org

Moving to pygame 2.0 has improved things somewhat (still tinkering), so thank you!

Only issue I've run across in moving to pygame 2.0 is this block of code, which is part of a routine that shows a little square popup when launching an emulator.  The text in 1.9.1 shows up fine, but in 2.0 I just see black boxes where the text region and text would be.  The Font.render API didn't seem to change so I'm not sure what it could be.

        for l in lines:

            text    = _info_font.render( l, 1, _fg_color )
            textpos = text.get_rect()

            if textpos.width > _info_rect.width:
                textpos.width = _info_rect.width

            x = _info_rect.left + ( 2 * _item_padding ) + ( ( _info_rect.width - textpos.width ) / 2 )

            offset = ( _info_font_size + _item_spacing ) * count
            textpos = textpos.move( x, y + offset )

            _screen.blit( text, textpos )

            count += 1


On 11/23/2020 3:50 PM, Michael Palmer wrote:
Pygame2.x will work on python2.7.

I stuck with that version for quite some time myself, but moving to 3.x was the best thing I ever did.
Reply all
Reply to author
0 new messages