TextureCollection

from panda3d.core import TextureCollection
class TextureCollection

Bases:

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

Inheritance diagram

Inheritance diagram of TextureCollection

__add__(other: TextureCollection) TextureCollection
__getitem__(index: int) Texture

Returns the nth Texture in the collection. This is the same as get_texture(), but it may be a more convenient way to access it.

__iadd__(other: TextureCollection) TextureCollection
__init__()
__init__(sequence: object)
__init__(copy: TextureCollection)
__reduce__() object
add_texture(texture: Texture)

Adds a new Texture to the collection.

add_textures_from(other: TextureCollection)

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.

append(texture: Texture)

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

assign(copy: TextureCollection) TextureCollection
clear()

Removes all Textures from the collection.

extend(other: TextureCollection)

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

find_texture(name: str) Texture

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

get_num_textures() int

Returns the number of Textures in the collection.

get_texture(index: int) Texture

Returns the nth Texture in the collection.

get_textures() list
has_texture(texture: Texture) bool

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

output(out: ostream)

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

remove_duplicate_textures()

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.

remove_texture(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.

remove_textures_from(other: TextureCollection)

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

reserve(num: int)

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.

size() int

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

write(out: ostream, indent_level: int)

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