panda3d.physics.SpriteParticleRenderer

from panda3d.physics import SpriteParticleRenderer
class SpriteParticleRenderer

Bases: BaseParticleRenderer

Renders a particle system with high-speed nasty trick sprites.

Inheritance diagram

Inheritance diagram of SpriteParticleRenderer

__init__(copy: SpriteParticleRenderer) → None

copy constructor

__init__(tex: Texture) → None

constructor

setFromNode(node_path: NodePath, size_from_texels: bool) → None

Sets the properties on this renderer from the geometry referenced by the indicated NodePath. This should be a reference to a GeomNode or a SequenceNode; it extracts out the texture and UV range from the node.

This will remove all previously added textures and animations. It will also resize the renderer to match this new geometry.

If node_path refers to a GeomNode(or has one beneath it) the texture, its size, and UV data will be extracted from that.

If node_path references a SequenceNode(or has one beneath it) with multiple GeomNodes beneath it, the size data will correspond only to the first GeomNode found with a valid texture, while the texture and UV information will be stored for each individual node.

If size_from_texels is true, the particle size is based on the number of texels in the source image; otherwise, it is based on the size of the first polygon found in the node.

model and node are the two items used to construct node_path. If the source type is important, use set_from_node(NodePath,string,string,bool) instead.

setFromNode(node_path: NodePath, model: str, node: str, size_from_texels: bool) → None

If the source type is important, use this one.

model and node should lead to node_path like this: node_path = loader.loadModel(model).find(node)

This will remove all previously add textures and resize the renderer to match the new geometry.

addFromNode(node_path: NodePath, size_from_texels: bool, resize: bool) → None

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

addFromNode(node_path: NodePath, model: str, node: str, size_from_texels: bool, resize: bool) → None

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If the source type is important, use this one.

model and node should lead to node_path like this: node_path = loader.loadModel(model).find(node)

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

setTexture(tex: Texture, texels_per_unit: float) → None

Sets the renderer up to render the entire texture image. The scale of each particle is based on the size of the texture in each dimension, modified by texels_per_unit.

Used to set the size of the particles. Will clear all previously loaded textures and animations.

addTexture(tex: Texture, texels_per_unit: float, resize: bool) → None

Adds texture to image pool, effectively creating a single frame animation that can be selected at particle birth. This should only be called after a previous call to setTexture().

removeAnimation(n: int) → None

Removes an animation texture set from the renderer.

setLlUv(ll_uv: LTexCoord) → None

Sets the UV coordinate of the lower-left corner of all the sprites generated by this renderer. Normally this is (0, 0), but it might be set to something else to use only a portion of the texture.

setLlUv(ll_uv: LTexCoord, anim: int, frame: int) → None

Sets the UV coordinate of the lower-left corner of all the sprites generated by this renderer. Normally this is (0, 0), but it might be set to something else to use only a portion of the texture.

setUrUv(ur_uv: LTexCoord) → None

Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer. Normally this is (1, 1), but it might be set to something else to use only a portion of the texture.

setUrUv(ur_uv: LTexCoord, anim: int, frame: int) → None

Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer. Normally this is (1, 1), but it might be set to something else to use only a portion of the texture.

setSize(width: float, height: float) → None

Sets the size of each particle in world units.

setColor(color: LColor) → None
setXScaleFlag(animate_x_ratio: bool) → None
setYScaleFlag(animate_y_ratio: bool) → None
setAnimAngleFlag(animate_theta: bool) → None
setInitialXScale(initial_x_scale: float) → None
setFinalXScale(final_x_scale: float) → None
setInitialYScale(initial_y_scale: float) → None
setFinalYScale(final_y_scale: float) → None
setNonanimatedTheta(theta: float) → None
setAlphaBlendMethod(bm: ParticleRendererBlendMethod) → None
setAlphaDisable(ad: bool) → None
setAnimateFramesEnable(an: bool) → None
setAnimateFramesRate(r: float) → None
setAnimateFramesIndex(i: int) → None
getTexture() → Texture
Return type

Texture

getTexture(anim: int, frame: int) → Texture
Return type

Texture

getNumAnims() → int
getAnim(n: int) → SpriteAnim
Return type

SpriteAnim

getLastAnim() → SpriteAnim
Return type

SpriteAnim

getColorInterpolationManager() → ColorInterpolationManager
Return type

ColorInterpolationManager

getLlUv() → LTexCoord

Returns the UV coordinate of the lower-left corner; see setLlUv().

Return type

LTexCoord

getLlUv(anim: int, frame: int) → LTexCoord

Returns the UV coordinate of the lower-left corner; see setLlUv().

Return type

LTexCoord

getUrUv() → LTexCoord

Returns the UV coordinate of the lower-left corner; see setUrUv().

Return type

LTexCoord

getUrUv(anim: int, frame: int) → LTexCoord

Returns the UV coordinate of the upper-right corner; see setUrUv().

Return type

LTexCoord

getWidth() → float

Returns the width of each particle in world units.

getHeight() → float

Returns the height of each particle in world units.

getColor() → LColor
Return type

LColor

getXScaleFlag() → bool
getYScaleFlag() → bool
getAnimAngleFlag() → bool
getInitialXScale() → float
getFinalXScale() → float
getInitialYScale() → float
getFinalYScale() → float
getNonanimatedTheta() → float
getAlphaBlendMethod() → ParticleRendererBlendMethod
Return type

ParticleRendererBlendMethod

getAlphaDisable() → bool
getAnimateFramesEnable() → bool
getAnimateFramesRate() → float
getAnimateFramesIndex() → int
getAnims() → list