Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96130
| References | <55eeab88$0$22574$426a74cc@news.free.fr> <ahptuap2f1lntqjvimakoul7ue1ie864qn@4ax.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2015-09-08 08:12 -0600 |
| Subject | Re: pygame basic question |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.224.1441721608.8327.python-list@python.org> (permalink) |
On Tue, Sep 8, 2015 at 8:01 AM, Dave Farrance <df@see.replyto.invalid> wrote:
> "ast" <nomail@invalid.com> wrote:
>
>>DISPLAYSURF = pygame.display.set_mode((400, 300))
>>pygame.display.set_caption('Hello World!')
>>
>>The first line opens a 400x300 pygame window.
>>The second one writes "Hello World" on top of it.
>>
>>I am just wondering how function set_caption finds the windows
>>since the window's name DISPLAYSURF is not passed as
>>an argument
>
> https://www.pygame.org/docs/ref/display.html
>
> As it says, there is only *one* display surface, and any non-displayed
> surface must be blitted (copied) onto the display surface for
> visibility. So all "pygame.display" methods refer to that one display
> surface. Non displayed surfaces, on the other hand, do need to be
> instantiated with "pygame.Surface"
Also, note that the display surface DISPLAYSURF is not the window.
It's just a Surface object that pygame uses to paint the contents of
the window. AFAIK pygame maintains the actual window data structures
internally and does not expose them to the API.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
pygame basic question "ast" <nomail@invalid.com> - 2015-09-08 11:33 +0200
Re: pygame basic question Laura Creighton <lac@openend.se> - 2015-09-08 12:14 +0200
Re: pygame basic question Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-08 12:03 +0100
Re: pygame basic question Dave Farrance <df@see.replyto.invalid> - 2015-09-08 15:01 +0100
Re: pygame basic question Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-08 08:12 -0600
csiph-web