Trouble with set_color

Trouble with set_color

Postby dboxall123 » Tue Jul 23, 2013 8:23 pm

Hello everyone. I'm quite new to pygame and I'm trying to make a 'Frogger' game. After searching all over and not finding anything, I searched on Google.I found a lovely little pic of a pixel frog, and saved it as frog.png. Then I wrote this in my code:

Code: Select all

When I blit the image, the white rectangle around the image is still there, but with black dots all over it. So after hunting in the internet, I found a solution that someone had posted:

Code: Select all

This has no effect whatsoever, the white rectangle is still there, hasn't even got the black dots in it. Does anyone have any ideas? If there is nothing that I can do, I'll try to draw a basic frog in pygame myself(nothing fancy,just a few rectangles and a couple of circles for eyes). If I do this, how can i assign these drawings to a sprite class?
Posts: 122
Joined: Fri Jul 12, 2013 5:28 pm

Re: Trouble with set_color

Postby Mekire » Wed Jul 24, 2013 12:33 am

Could you please link to the image? If the image is on a solid background you can use standard convert() and then set the colorkey to the background color (white or black however are not advisable as you would then be unable to use them in your image). If the background of the image is transparent then you should use convert_alpha() (color key will have no effect on a surface that already contains per-pixel alpha).

New Users, Read This
  • Use code tags when posting code.
  • Include any errors with your post (in code tags).
  • Describe your problem; not your chosen solution.
  • Make examples the minimum length to demonstrate your issue.
User avatar
Posts: 1711
Joined: Thu Feb 07, 2013 11:33 pm
Location: Tucson, Arizona

Return to Game Development

Who is online

Users browsing this forum: No registered users and 4 guests