Creating multiple screens in pygame

后端 未结 2 1110
隐瞒了意图╮
隐瞒了意图╮ 2021-01-22 04:31

Is there any way way to create multiple screens in Pygame without redrawing to the screen every time. For example, if we want to create a splash screen, then a main menu with bu

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-22 05:10

    Depends on what you mean.

    If you mean making multiple windows at the same time, no, you can't do that--it's a limitation of SDL (although you CAN fake it by using multiprocessing (not multithreading)).

    If you mean changing one screen around, yes, you can do that, with multiple calls to pygame.display.set_mode(...). You can change the resolution, arguments, etc. If you're doing OpenGL stuff, that will remake the context too.

    If you just mean drawing different things to the same window, of course! That's sorta the point of PyGame.

    Other than that, you'll have to clarify.

提交回复
热议问题