Panda3D
Public Member Functions | Public Attributes | List of all members
TextGraphic Class Reference

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

#include "textGraphic.h"

Public Member Functions

 TextGraphic (const NodePath &model, const LVecBase4 &frame)
 
 TextGraphic (const NodePath &model, PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
 
LVecBase4 get_frame () const
 
bool get_instance_flag () const
 
NodePath get_model () const
 
void set_frame (const LVecBase4 &frame)
 
void set_frame (PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
 
void set_instance_flag (bool instance_flag)
 
void set_model (const NodePath &model)
 

Public Attributes

 get_frame
 Returns the frame specified for the graphic. More...
 
 get_instance_flag
 Returns the instance_flag. More...
 
 get_model
 Returns the NodePath associated with the graphic, that renders the desired image. More...
 
 set_frame
 Specifies the (left, right, bottom, top) bounding frame for the graphic. More...
 
 set_instance_flag
 Sets the instance_flag. More...
 
 set_model
 Changes the NodePath associated with the graphic. More...
 

Detailed Description

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.

Definition at line 37 of file textGraphic.h.

Member Data Documentation

◆ get_frame

LVecBase4 TextGraphic::get_frame
inline

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

Definition at line 50 of file textGraphic.h.

Referenced by TextAssembler::calc_width().

◆ get_instance_flag

bool TextGraphic::get_instance_flag
inline

Returns the instance_flag.

See set_instance_flag().

Definition at line 54 of file textGraphic.h.

◆ get_model

NodePath TextGraphic::get_model
inline

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

Definition at line 45 of file textGraphic.h.

◆ set_frame

void TextGraphic::set_frame
inline

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

See get_frame().

Definition at line 50 of file textGraphic.h.

◆ set_instance_flag

void TextGraphic::set_instance_flag
inline

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.

Definition at line 54 of file textGraphic.h.

◆ set_model

void TextGraphic::set_model
inline

Changes the NodePath associated with the graphic.

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

Definition at line 45 of file textGraphic.h.


The documentation for this class was generated from the following files: