Package motherhamster :: Module displayGL :: Class TexturePack

Class TexturePack



A class that corresponds to an allocated openGL texture it tracks what objects are in the texture and what areas are free

Instance Methods
 
__init__(self, size)
Initialize the TexturePack object.
 
__del__(self)
 
lose_all_images(self)
Erases all the image textures and resets the list of available zones
 
release_all(self)
Reset this TexturePack object
 
pack_image(self, image)
tries to put the data for an image in this texture pack.
 
as_surface(self)
gets the contents of the texture as a pygame surface
 
get_info(self)
 
lose_image(self, obj)
unloads an image from the texture pack
Static Methods
 
get_perferred_allocation_size(image)
get the recommended TexturePack allocation size to hold this image
Method Details

__init__(self, size)
(Constructor)

 
Initialize the TexturePack object. Expects one argument, which is a vector representing the width and height

pack_image(self, image)

 
tries to put the data for an image in this texture pack. if successful, it returns true and adds attributes to the image