[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Split screen question (newbie)



If you have any more questions on the rest of it we are here :)  If
you get stuck and feel like you are in too deep you can always start
another project.

On second thought, that's what I do, and it's left me with 1000's of
failures.  Maybe sticking to it would have been a better idea...

One of these days I'll have a success.

We R all Noobs of something :)

BTW that subsurface trick was awesome Casey.

Good luck mundial!

On Nov 22, 2007 12:32 AM, Mundial 82 <mundial82@xxxxxxxxx> wrote:
> Hi all,
>
> First, thanks a lot for all the help!
> Ups, now I feel some performance anxiety :) As soon as my little
> artsy fartsy experiment is ready, I will share it for feedback. But,
> since I am a noob and this is my first "original IP" ;) it may take a
> while to figure out the implementation of the basic mechanics.
> As for the subsurfaces explanation - thanks a lot! that makes a lot
> of sense :)
>
> cheers
>
> Naranjito
>
>
>
> On Nov 22, 2007, at 3:28 AM, Casey Duncan wrote:
>
> > On Nov 21, 2007, at 5:57 PM, Kris Schnee wrote:
> >> [..]
> >> With subsurfaces, eh? I was thinking more like:
> >> <code>
> >> w,h = SCREEN_SIZE ## eg. (800,600)
> >> top_screen = pygame.surface.Surface((w,h/2))
> >> bot_screen = pygame.surface.Surface((w,h/2))
> >>
> >> def Draw():
> >>     DrawPlayerOneScreen(top_screen) ## Draw game stuff onto these
> >> surfaces
> >>     DrawPlayerTwoScreen(bot_screen)
> >>     screen.blit(top_screen,(0,0))
> >>     screen.blit(top_screen,(0,h/2))
> >>     pygame.display.update()
> >> </code>
> >>
> >> What's the purpose of using subsurfaces? I don't understand those.
> >
> > If you use subsurfaces, you don't need these lines at all:
> >
> >>     screen.blit(top_screen,(0,0))
> >>     screen.blit(top_screen,(0,h/2))
> >
> > Because when you blit to the subsurfaces, you are also blitting to
> > the screen (because subsurfaces share pixel data with their
> > parent). It means the system does less work and you use less
> > memory, but the effect is the same.
> >
> > -Casey
> >
>
>