[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] Newbie surfarray question



Is there a fast possibility to add/substract 2 surfarrays (for light/shadow 
effects) without getting those ugly effect. (if the value would be graeter 
than 255)
i finally got it working, but it is too slow

for i in range(x):
    for j in range(y):
        for k in range(3): # RGB
            a = long(imgarray[i,j,k]) + long(i2array[i,j,k])
            if a > 255:
                a = 255
            imgarray[i,j,k] = a

are there any tricks or is there just no way to do it?
 
-- 
Ciao Jan
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org