添付画像(B.png)の背景を透過させて表示する方法を教えてください。
透過済みの画像ですが、pygameを通すと透過部分は黒く表示され、透過させなかった場合は白いままで表示されてしまいます。
python
1 screen = pygame.display.set_mode(SCREENRECT) 2 # create the background, tile the bgd image 3 bck = load_image('A.jpg').convert() 4 5 # Set the display mode 6 screen.blit(bck, (0, 0)) 7 8 # button 9 button = load_image("B.png").convert_alpha() 10 buttonRect = pygame.Rect(BUTTON_POSITION, button.get_rect().size) 11 screen.blit(button, buttonRect) 12 13 pygame.display.flip()
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/06 12:06