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

Re: [pygame] Hello, how to display a background around a active play screen?



Hi Frank,

Does your game project has will have an option to change resolution of game screen (cabinet art + game area) ? or will it always got eg. fullscreen in one resolution only ( eg. fullscreen in 1024x768) ?
If the cabinet art is static then you can blit it into screen only once and only update changes in game area.

#Rough example
screen.blit(cab_art,(0,0);
while 1:
    #all your game stuff
    screen.blit(game_changes,(x,y)
    pygame.display.update()

Cheers
Bart

On Tue, Apr 30, 2013 at 3:39 PM, Frank Butcher <zxcomputeruser@xxxxxxxxx> wrote:
Cheers Paul, that's a big help.



On Tue, Apr 30, 2013 at 10:31 PM, Paul Vincent Craven <paul@xxxxxxxxxxxxxxxx> wrote:

Paul Vincent Craven


On Tue, Apr 30, 2013 at 9:23 AM, Frank Butcher <zxcomputeruser@xxxxxxxxx> wrote:
Thanks Paul, The image is a png, i use the transform_alpha() before I fliped the image, and it loads.

I had a look around and I cant seem to find a well documented pong example. is there one floating around on the net? the version I am looking at is quite complex (to my simple brain anyway.) What I was looking for is something simple and contained so I could play around with setting up a background graphic ect...




On Tue, Apr 30, 2013 at 9:35 PM, Paul Vincent Craven <paul@xxxxxxxxxxxxxxxx> wrote:
Make sure it isn't a JPG. See here if you want more info on how to set transparency:

Paul Vincent Craven


On Tue, Apr 30, 2013 at 8:15 AM, Frank Butcher <zxcomputeruser@xxxxxxxxx> wrote:
Hi Paul,

I meant cabinet graphic, but yea basically it was a graphic that would surround the play space. Thanks for your help I will have a play this evening and get it working.

Dan.


On Tue, Apr 30, 2013 at 9:08 PM, Paul Vincent Craven <paul@xxxxxxxxxxxxxxxx> wrote:
I'm not sure what you mean by 'cab', but if it is a graphic, just create the graphic, set the inside color to transparent using setcolorkey, then blit it to the screen after you do all your other drawing and before the flip.

Paul Vincent Craven


On Tue, Apr 30, 2013 at 3:46 AM, Frank Butcher <zxcomputeruser@xxxxxxxxx> wrote:
Afternoon,

Please forgive my newbie question.

I am trying to re-create a arcade cabinet design in pygame. So that the cab displays around the play area.

How can I do this? What I want is say the game to display in 600x400 and the cab to take up the rest of the screen.

Thanks,

Dan.