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

[pygame] Surface blitting not effective



Attached is the file in question, comet_fighter.py (version 0.1.0.5).

Game.menu() is supposed to show a menu. It takes the following arguments:

options, cursor, anim_wait, color=pygame.Color(0,0,0,155), border=16, sep=8

"options" is a list of surfaces used for the menu choices. "cursor" is a list of surfaces which animate to create the selection cursor. "anim_wait" is the time (in milliseconds) between each frame of animation for the cursor. "color" is a pygame.Color object with an alpha value, which is used to set the color and alpha of the back of the dialog. "border" indicates the number of pixels around the menu box, and "sep" is the number of pixels between each menu choice.

The problem is, it doesn't seem to be working like it should.

I tried calling Game.menu() in order to test it. It sort of worked, but not really. There are a few issues.

First, the back of the menu is always fully opaque or fully transparent. Partial transparency isn't working.

Second, and more importantly, the menu choices aren't showing up.

Everything else seems to be working perfectly. I scanned my code at least twice, and I couldn't find anything wrong with it. Perhaps someone else can have better luck, or perhaps I'm doing something wrong?

Attachment: comet_fighter-0.1.0.5.py
Description: Binary data