[英]Is there a way to make the message box show up in front of a PyGame Window?
对于学校,我们必须编写这个愚蠢的僵尸游戏,但无论如何,到问题上。
我正在使用模块 'ctypes' 在 python 中获取消息框,但是每当我们使用它时,消息框都会显示在 PyGame 窗口下方,这真的很烦人,因为我们必须单击底部的选项卡并这只是一种美化的痛苦。 这是代码:
answer = ctypes.windll.user32.MessageBoxW(0, "Save survivor using ammo?", "Oh no, a zombie is approaching!", 4)
if answer == 6:
survivor()
ammo -= 1
这是一个要求拯救幸存者或放弃他们的提示,但消息框一直显示在底部。 我可以应用某种参数将它放在 pygame 窗口前面吗?
MessageBox
支持uType
标志MB_TOPMOST
( 0x00040000
):
MB_YESNO = 4
MB_TOPMOST = 0x40000
uType = MB_YESNO | MB_TOPMOST
answer = ctypes.windll.user32.MessageBoxW(
0, "Save survivor using ammo?", "Oh no, a zombie is approaching!", uType)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.