[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
RE: [pygame] How to add text boxes and buttons
- To: <pygame-users@xxxxxxxx>
- Subject: RE: [pygame] How to add text boxes and buttons
- From: "Ben Olsen" <bolsen@xxxxxxxxx>
- Date: Wed, 21 Dec 2005 16:38:22 -0500
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Wed, 21 Dec 2005 16:40:43 -0500
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- Thread-index: AcYGdSes2gp2GaycQZO84hhBWCEIcgAAKKBw
- Thread-topic: [pygame] How to add text boxes and buttons
Marcus includes a large selection of examples to look at in the "doc"
directory. But the basic idea is:
1) Create a Renderer
2) Set up whatever widgets you need in the various game classes you've
written
3) Add the widgets to the Renderer
Personally I like to have all my game classes inherit from
ocempgui.object.BaseObject, so that I can easily control which signals
(the Renderer version of Events) get picked up by which objects. The
guiclient.py in the "chat" examples is a good place to see how to do
that.
Ben
> -----Original Message-----
> From: owner-pygame-users@xxxxxxxx [mailto:owner-pygame-users@xxxxxxxx]
On
> Behalf Of Johan Geldenhuys
> Sent: Wednesday, December 21, 2005 2:28 PM
> To: pygame-users@xxxxxxxx
> Subject: Re: [pygame] How to add text boxes and buttons
>
> Downloading it now over my GPRS internet connection, so it's a bit
slow.
> It looks great though.
>
> For learning, what is the best way going about it? Creating rects
in/on
> the surface? I'm still learning the lingo. ;-)
>
> Johan
>