擅长:python、mysql、java
<p>如果需要显示的实际大小,而不是使用的最佳分辨率,请执行以下操作:</p>
<pre><code>import pygame
pygame.display.init()
# Before calling *.set_mode()
i = pygame.display.Info()
width = i.current_w
height = i.current_h
print("The screen size is: (%ix%i)" %width, height))
</code></pre>
<p>然后可以使用宽度和高度pygame.display.set_模式()</p>