# panda3d.core.TextGraphic¶

class TextGraphic

This defines a special model that has been constructed for the purposes of embedding an arbitrary graphic image within a text paragraph.

It can be any arbitrary model, though it should be built along the same scale as the text, and it should probably be at least mostly two- dimensional. Typically, this means it should be constructed in the X-Z plane, and it should have a maximum vertical (Z) height of 1.0.

The frame specifies an arbitrary bounding volume in the form (left, right, bottom, top). This indicates the amount of space that will be reserved within the paragraph. The actual model is not actually required to fit within this rectangle, but if it does not, it may visually overlap with nearby text.

Inheritance diagram

__init__() → None
__init__(model: NodePath, frame: LVecBase4) → None
__init__(model: NodePath, left: float, right: float, bottom: float, top: float) → None
__init__(param0: TextGraphic) → None
getModel() → NodePath

Returns the NodePath associated with the graphic, that renders the desired image.

Return type

NodePath

setModel(model: NodePath) → None

Changes the NodePath associated with the graphic. This NodePath should contain geometry that will render the desired graphic image.

getFrame() → LVecBase4

Returns the frame specified for the graphic. This is the amount of space that will be reserved for the graphic when it is embedded in a text paragraph, in the form (left, right, bottom, top).

The actual graphic, as rendered by the NodePath specified via setModel(), should more or less fit within this rectangle. It is not required to fit completely within it, but if it does not, it may visually overlap with nearby text.

Return type

LVecBase4

setFrame(frame: LVecBase4) → None

Specifies the (left, right, bottom, top) bounding frame for the graphic. See getFrame().

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

Specifies the (left, right, bottom, top) bounding frame for the graphic. See getFrame().

getInstanceFlag() → bool

Returns the instance_flag. See setInstanceFlag().

setInstanceFlag(instance_flag: bool) → None

Sets the instance_flag. When this is true, the graphic is directly instanced to the scene graph whenever it appears; when it is false, the graphic is copied. The default is false, which is best for most applications. You might need to set it true for special kinds of “graphics” like interactive elements, for instance a PGEntry.

property model
Getter

Returns the NodePath associated with the graphic, that renders the desired image.

Setter

Changes the NodePath associated with the graphic. This NodePath should contain geometry that will render the desired graphic image.

Return type

NodePath

property frame
Getter

Returns the frame specified for the graphic. This is the amount of space that will be reserved for the graphic when it is embedded in a text paragraph, in the form (left, right, bottom, top).

The actual graphic, as rendered by the NodePath specified via setModel(), should more or less fit within this rectangle. It is not required to fit completely within it, but if it does not, it may visually overlap with nearby text.

Setter

Specifies the (left, right, bottom, top) bounding frame for the graphic. See getFrame().

Specifies the (left, right, bottom, top) bounding frame for the graphic. See getFrame().

Return type

LVecBase4

property instance_flag
Getter

Returns the instance_flag. See setInstanceFlag().

Setter

Sets the instance_flag. When this is true, the graphic is directly instanced to the scene graph whenever it appears; when it is false, the graphic is copied. The default is false, which is best for most applications. You might need to set it true for special kinds of “graphics” like interactive elements, for instance a PGEntry.

Return type

bool