panda3d.core.TextureCollection

class TextureCollection

Manages a list of Texture objects, as returned by TexturePool.findAllTextures().

Inheritance diagram

Inheritance diagram of TextureCollection

__init__() → None
__init__(sequence: object) → None
__init__(copy: TextureCollection) → None
assign(copy: TextureCollection) → TextureCollection
Return type

TextureCollection

addTexture(texture: Texture) → None

Adds a new Texture to the collection.

removeTexture(texture: Texture) → bool

Removes the indicated Texture from the collection. Returns true if the texture was removed, false if it was not a member of the collection.

addTexturesFrom(other: TextureCollection) → None

Adds all the Textures indicated in the other collection to this texture. The other textures are simply appended to the end of the textures in this list; duplicates are not automatically removed.

removeTexturesFrom(other: TextureCollection) → None

Removes from this collection all of the Textures listed in the other collection.

removeDuplicateTextures() → None

Removes any duplicate entries of the same Textures on this collection. If a Texture appears multiple times, the first appearance is retained; subsequent appearances are removed.

hasTexture(texture: Texture) → bool

Returns true if the indicated Texture appears in this collection, false otherwise.

clear() → None

Removes all Textures from the collection.

reserve(num: size_t) → None

This is a hint to Panda to allocate enough memory to hold the given number of NodePaths, if you know ahead of time how many you will be adding.

findTexture(name: str) → Texture

Returns the texture in the collection with the indicated name, if any, or NULL if no texture has that name.

Return type

Texture

getNumTextures() → int

Returns the number of Textures in the collection.

getTexture(index: int) → Texture

Returns the nth Texture in the collection.

Return type

Texture

size() → int

Returns the number of textures in the collection. This is the same thing as getNumTextures().

append(texture: Texture) → None

Adds a new Texture to the collection. This method duplicates the addTexture() method; it is provided to satisfy Python’s naming convention.

extend(other: TextureCollection) → None

Appends the other list onto the end of this one. This method duplicates the += operator; it is provided to satisfy Python’s naming convention.

output(out: ostream) → None

Writes a brief one-line description of the TextureCollection to the indicated output stream.

write(out: ostream, indent_level: int) → None

Writes a complete multi-line description of the TextureCollection to the indicated output stream.

getTextures() → list