Deepak
Deepak

Reputation: 1545

Trying to understand meaning of a parameter in pygame.

this is the function I am trying to understand:

def load_image(name, colorkey=None):
    fullname = os.path.join('data', name)
    try:
        image = pygame.image.load(fullname)
    except pygame.error, message:
        print 'Cannot load image:', name
        raise SystemExit, message
    image = image.convert()
    if colorkey is not None:
        if colorkey is -1:
            colorkey = image.get_at((0,0))
        image.set_colorkey(colorkey, RLEACCEL)
    return image, image.get_rect()

I understand almost all of it except of the line:

        image.set_colorkey(colorkey, RLEACCEL)

what is RLEACCEL in this line? is it just a random name of a variable so an rbg value can fit here or something else?

here is the link of tutorial where I saw this code: link

Upvotes: 1

Views: 1541

Answers (1)

drum
drum

Reputation: 5651

RLE means Run-length encoding. http://en.wikipedia.org/wiki/Run-length_encoding

RLEACCEL is the flag to denote Surface which is RLE encoded. http://www.pygame.org/docs/ref/surface.html

Upvotes: 2

Related Questions