TextPropertiesManager

from panda3d.core import TextPropertiesManager
class TextPropertiesManager

Bases: DTOOL_SUPER_BASE

This defines all of the TextProperties structures that might be referenced by name from an embedded text string.

A text string, as rendered by a TextNode, can contain embedded references to one of the TextProperties defined here, by enclosing the name between 1 (ASCII 0x01) characters; this causes a “push” to the named state. All text following the closing 1 character will then be rendered in the new state. The next 2 (ASCII 0x02) character will then restore the previous state for subsequent text.

For instance, “x1up1n2 + y” indicates that the character “x” will be rendered in the normal state, the character “n” will be rendered in the “up” state, and then ” + y” will be rendered in the normal state again.

This can also be used to define arbitrary models that can serve as embedded graphic images in a text paragraph. This works similarly; the convention is to create a TextGraphic that describes the graphic image, and then associate it here via the set_graphic() call. Then “5name5” will embed the named graphic.

Inheritance diagram

Inheritance diagram of TextPropertiesManager

__init__(*args, **kwargs)
clearGraphic()

C++ Interface: clear_graphic(const TextPropertiesManager self, str name)

/**
  • Removes the named TextGraphic structure from the manager.

*/

clearProperties()

C++ Interface: clear_properties(const TextPropertiesManager self, str name)

/**
  • Removes the named TextProperties structure from the manager.

*/

clear_graphic()

C++ Interface: clear_graphic(const TextPropertiesManager self, str name)

/**
  • Removes the named TextGraphic structure from the manager.

*/

clear_properties()

C++ Interface: clear_properties(const TextPropertiesManager self, str name)

/**
  • Removes the named TextProperties structure from the manager.

*/

getGlobalPtr()

C++ Interface: get_global_ptr()

/**
  • Returns the pointer to the global TextPropertiesManager object.

*/

getGraphic()

C++ Interface: get_graphic(const TextPropertiesManager self, str name)

/**
  • Returns the TextGraphic associated with the indicated name. If there was

  • not previously a TextGraphic associated with this name, a warning is

  • printed and then a default TextGraphic structure is associated with the

  • name, and returned.

  • Call has_graphic() instead to check whether a particular name has been

  • defined.

*/

getProperties()

C++ Interface: get_properties(const TextPropertiesManager self, str name)

/**
  • Returns the TextProperties associated with the indicated name. If there

  • was not previously a TextProperties associated with this name, a warning is

  • printed and then a default TextProperties structure is associated with the

  • name, and returned.

  • Call has_properties() instead to check whether a particular name has been

  • defined.

*/

get_global_ptr()

C++ Interface: get_global_ptr()

/**
  • Returns the pointer to the global TextPropertiesManager object.

*/

get_graphic()

C++ Interface: get_graphic(const TextPropertiesManager self, str name)

/**
  • Returns the TextGraphic associated with the indicated name. If there was

  • not previously a TextGraphic associated with this name, a warning is

  • printed and then a default TextGraphic structure is associated with the

  • name, and returned.

  • Call has_graphic() instead to check whether a particular name has been

  • defined.

*/

get_properties()

C++ Interface: get_properties(const TextPropertiesManager self, str name)

/**
  • Returns the TextProperties associated with the indicated name. If there

  • was not previously a TextProperties associated with this name, a warning is

  • printed and then a default TextProperties structure is associated with the

  • name, and returned.

  • Call has_properties() instead to check whether a particular name has been

  • defined.

*/

hasGraphic()

C++ Interface: has_graphic(TextPropertiesManager self, str name)

/**
  • Returns true if a TextGraphic structure has been associated with the

  • indicated name, false otherwise. Normally this means set_graphic() has

  • been called with this name, but because get_graphic() will implicitly

  • create a default TextGraphic structure, it may also mean simply that

  • get_graphic() has been called with the indicated name.

*/

hasProperties()

C++ Interface: has_properties(TextPropertiesManager self, str name)

/**
  • Returns true if a TextProperties structure has been associated with the

  • indicated name, false otherwise. Normally this means set_properties() has

  • been called with this name, but because get_properties() will implicitly

  • create a default TextProperties structure, it may also mean simply that

  • get_properties() has been called with the indicated name.

*/

has_graphic()

C++ Interface: has_graphic(TextPropertiesManager self, str name)

/**
  • Returns true if a TextGraphic structure has been associated with the

  • indicated name, false otherwise. Normally this means set_graphic() has

  • been called with this name, but because get_graphic() will implicitly

  • create a default TextGraphic structure, it may also mean simply that

  • get_graphic() has been called with the indicated name.

*/

has_properties()

C++ Interface: has_properties(TextPropertiesManager self, str name)

/**
  • Returns true if a TextProperties structure has been associated with the

  • indicated name, false otherwise. Normally this means set_properties() has

  • been called with this name, but because get_properties() will implicitly

  • create a default TextProperties structure, it may also mean simply that

  • get_properties() has been called with the indicated name.

*/

setGraphic()

C++ Interface: set_graphic(const TextPropertiesManager self, str name, const TextGraphic graphic) set_graphic(const TextPropertiesManager self, str name, const NodePath model)

/**
  • Defines the TextGraphic associated with the indicated name. When the name

  • is subsequently encountered in text embedded between 5 characters in a

  • TextNode string, the specified graphic will be embedded in the text at that

  • point.

  • If there was already a TextGraphic structure associated with this name, it

  • is quietly replaced with the new definition.

*/

/**
  • This flavor of set_graphic implicitly creates a frame for the model using

  • the model’s actual computed bounding volume, as derived from

  • NodePath::calc_tight_bounds(). Create a TextGraphic object first if you

  • want to have explicit control of the frame.

*/

setProperties()

C++ Interface: set_properties(const TextPropertiesManager self, str name, const TextProperties properties)

/**
  • Defines the TextProperties associated with the indicated name. When the

  • name is subsequently encountered in text embedded between 1 characters in

  • a TextNode string, the following text will be rendered with these

  • properties.

  • If there was already a TextProperties structure associated with this name,

  • it is quietly replaced with the new definition.

*/

set_graphic()

C++ Interface: set_graphic(const TextPropertiesManager self, str name, const TextGraphic graphic) set_graphic(const TextPropertiesManager self, str name, const NodePath model)

/**
  • Defines the TextGraphic associated with the indicated name. When the name

  • is subsequently encountered in text embedded between 5 characters in a

  • TextNode string, the specified graphic will be embedded in the text at that

  • point.

  • If there was already a TextGraphic structure associated with this name, it

  • is quietly replaced with the new definition.

*/

/**
  • This flavor of set_graphic implicitly creates a frame for the model using

  • the model’s actual computed bounding volume, as derived from

  • NodePath::calc_tight_bounds(). Create a TextGraphic object first if you

  • want to have explicit control of the frame.

*/

set_properties()

C++ Interface: set_properties(const TextPropertiesManager self, str name, const TextProperties properties)

/**
  • Defines the TextProperties associated with the indicated name. When the

  • name is subsequently encountered in text embedded between 1 characters in

  • a TextNode string, the following text will be rendered with these

  • properties.

  • If there was already a TextProperties structure associated with this name,

  • it is quietly replaced with the new definition.

*/

write()

C++ Interface: write(TextPropertiesManager self, ostream out, int indent_level)

/**

*/