surface整体透明度测试程序_pygame whole alpha test program

surface整体透明度测试程序_pygame whole alpha test program

下面是部分代码预览:

"""
   surface整体透明度测试程序.py
   用surface的set_alpha设定透明度。
   这种情况的透明度只能给图像设置一个整体透明度。
   不象每像素透明度设置那样可以精确到每一个像素的a值来给图像设置透明度。
   pygame the full Surface alpha test program  by lixingqiu
"""
import pygame
from random import randint
from pygame.locals import *
    
screen = pygame.display.set_mode((480,360))
pygame.display.set_caption("surface整体透明度测试程序 www.lixingqiu.com")

# ultraman做为背景
ultraman = pygame.image.load('ultraman.png').convert()
earth = pygame.image.load("earth.png").convert()
width2 = earth.get_width()//2
height2 = earth.get_height()//2 

 

下载完整源代码与素材,请

成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)

李兴球

李兴球的博客是Python创意编程原创博客