CardMaker

from panda3d.core import CardMaker
class CardMaker

Bases:

Bases: Namable

This class generates 2-d “cards”, that is, rectangular polygons, particularly useful for showing textures etc. in the 2-d scene graph.

Inheritance diagram

Inheritance diagram of CardMaker

__init__(param0: CardMaker)
__init__(name: str)
clearColor()

Unsets the color of the card.

clearSourceGeometry()

Removes the node specified by an earlier call to setSourceGeometry().

generate() PandaNode

Generates a GeomNode that renders the specified geometry.

reset()

Resets all the parameters to their initial defaults.

setColor(color: LColor)
setColor(r: float, g: float, b: float, a: float)

Sets the color of the card.

setFrame(frame: LVecBase4)

Sets the size of the card.

setFrame(ll: LVertex, lr: LVertex, ur: LVertex, ul: LVertex)

Sets the size of the card.

setFrame(left: float, right: float, bottom: float, top: float)

Sets the size of the card.

setFrameFullscreenQuad()

Sets the card to (-1,1,-1,1), which is appropriate if you plan to parent it to render2d and use it as a fullscreen quad.

setHas3dUvs(flag: bool)

Sets the flag indicating whether vertices will be generated with 3-component UVW’s (true) or 2-component UV’s (the default, false). Normally, this will be implicitly set by setting the uv_range.

setHasNormals(flag: bool)

Sets the flag indicating whether vertices will be generated with normals or not. Normals are required if you intend to enable lighting on the card, but are just wasted space and bandwidth otherwise, so there is a (slight) optimization for disabling them. If enabled, the normals will be generated perpendicular to the card’s face.

setHasUvs(flag: bool)

Sets the flag indicating whether vertices will be generated with UV’s or not.

setSourceGeometry(node: PandaNode, frame: LVecBase4)

Sets a node that will be copied (and scaled and translated) to generate the frame, instead of generating a new polygon. The node may contain arbitrary geometry that describes a flat polygon contained within the indicated left, right, bottom, top frame.

When generate() is called, the geometry in this node will be scaled and translated appropriately to give it the size and aspect ratio specified by setFrame().

setUvRange(ll: LTexCoord, ur: LTexCoord)

Sets the range of UV’s that will be applied to the vertices. If setHasUvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

setUvRange(ll: LTexCoord, lr: LTexCoord, ur: LTexCoord, ul: LTexCoord)

Sets the range of UV’s that will be applied to the vertices. If setHasUvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

setUvRange(ll: LTexCoord3, lr: LTexCoord3, ur: LTexCoord3, ul: LTexCoord3)

Sets the range of UV’s that will be applied to the vertices. If setHasUvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

setUvRange(x: LVector4, y: LVector4, z: LVector4)

Sets the range of UV’s that will be applied to the vertices. If setHasUvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

setUvRange(tex: Texture)

Sets the range of UV’s that will be applied to the vertices appropriately to show the non-pad region of the texture.

setUvRangeCube(face: int)

Sets the range of UV’s that will be applied to the vertices appropriately for a cube-map face.