# panda3d.core.CardMaker¶

class CardMaker

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

__init__(param0: CardMaker) → None
__init__(name: str) → None
reset() → None

Resets all the parameters to their initial defaults.

setUvRange(ll: LTexCoord, ur: LTexCoord) → None

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) → None

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) → None

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) → None

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) → None

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) → None

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

setHasUvs(flag: bool) → None

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

setHas3dUvs(flag: bool) → None

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.

setFrame(frame: LVecBase4) → None

Sets the size of the card.

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

Sets the size of the card.

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

Sets the size of the card.

setFrameFullscreenQuad() → None

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.

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

Sets the color of the card.

setHasNormals(flag: bool) → None

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.

setSourceGeometry(node: PandaNode, frame: LVecBase4) → None

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

clearSourceGeometry() → None

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

generate() → PandaNode

Generates a GeomNode that renders the specified geometry.

Return type

PandaNode