TextureAtlas
(width=256, height=256)¶Collection of images within a texture.
Constructor:
__init__
(width=256, height=256)¶Create a texture atlas of the given size.
Parameters: |
|
---|
Methods:
add
(img)Add an image to the atlas.
TextureAtlas.
add
(img)¶Add an image to the atlas.
This method will fail if the given image cannot be transferred directly to a texture (for example, if it is another texture). ImageData is the usual image type for this method.
AllocatorException will be raised if there is no room in the atlas for the image.
Parameters: | img (AbstractImage) – The image to add. |
---|---|
Return type: | TextureRegion |
Returns: | The region of the atlas containing the newly added image. |