The flags argument controls which type of display you want. That SCALED is considered an experimental API and may change in future Mouse events are scaled for you, so your game doesn't need to do it. The game thinks it's a 640x480 window, but really it can be bigger. Show up very small so that they are unplayable. On high resolution displays(4k, 1080p) and tiny graphics games (640x480) The returned surface will still always match When requesting fullscreen display modes, sometimes an exact match for the Will emulate an unavailable color depth which can be slow. Specific color format you can control the depth with this argument. It will default to theīest and fastest color depth for the system. It is usually best to not pass the depth argument. SDL version prior to 1.2.10 will raise an exception. Surface will have the same width or height as the screen resolution. If only the width or height are set to 0, the Version 1.2.10 or above, the created Surface will have the same size as theĬurrent screen resolution. If no size is passed or is set to (0, 0) and pygame uses SDL The Surface that gets returned can be drawn to like a regular Surface butĬhanges will eventually be seen on the monitor. The depthĪrgument represents the number of bits to use for color. The flags argument is a collection of additional options. The size argument is a pair of numbers representing the width and Note that calling this function implicitly initializes pygame.display, if The actual created display will be the best This function will create a display Surface. In the pygame examples directory, there isĮxample code (prevent_display_stretching.py) which shows how to disable thisĪutomatic stretching of the pygame display on Microsoft Windows (Vista or newer When this option is enabled, this automatic stretching distorts theĪppearance of the pygame window. Some display environments have an option for automatically stretching all Screen will get pygame.VIDEOEXPOSE events when portions of the window mustĪ new windowevent API was introduced in pygame 2.0.1. Hardware displays that draw direct to the Pygame.RESIZABLE flag, pygame.VIDEORESIZE events will be sent when the The window will receive pygame.ACTIVEEVENT events as the display pygame.QUIT is sent when the user has requested the program to When the display mode is set, several events are placed on the pygame event If a new display mode is set, the existing Surface willĪutomatically switch to operate on the new display. The Surface becomes invalid if the module is Once the display Surface is created, the functions from this module affect the () to query detailed information about the display. Graphics cards and CRT screens, but is usually not needed any more. _desktop_sizes and then select appropriate window sizeĪnd display index to pass to _mode().įor backward compatibility pygame.display allows precise control over The number and size of attached screens, you can use With _mode() will close the previous display. Pygame can only have a single display active at any time. These areĬontrolled by flags passed to _mode(). Special modules like automatic scaling or OpenGL support. Byĭefault, the display is a basic software driven framebuffer. The pygame display can actually be initialized in one of several modes. Both axes increase positively towards the bottom right of the screen. The origin of the display, where x = 0 and y = 0, is the top left of the Immediately visible onscreen you must choose one of the two flipping functions Once youĬreate the display you treat it as a regular Surface. Surface that is either contained in a window or runs full screen. This module offers control over the pygame display.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |