TextureCollection
from panda3d.core import TextureCollection
- class TextureCollection
Bases:
Manages a list of Texture objects, as returned by
TexturePool.findAllTextures()
.Inheritance diagram
- __add__(other: TextureCollection) TextureCollection
- __getitem__(index: int) Texture
Returns the nth Texture in the collection. This is the same as
getTexture()
, but it may be a more convenient way to access it.
- __iadd__(other: TextureCollection) TextureCollection
- __init__()
- __init__(sequence: object)
- __init__(copy: TextureCollection)
- addTexturesFrom(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
addTexture()
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.
- findTexture(name: str) Texture
Returns the texture in the collection with the indicated name, if any, or NULL if no texture has that name.
- hasTexture(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.
- removeDuplicateTextures()
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.
- 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.
- removeTexturesFrom(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
getNumTextures()
.
- write(out: ostream, indent_level: int)
Writes a complete multi-line description of the
TextureCollection
to the indicated output stream.