SOTEXT2(3iv)
π NAME π
SoText2 β the screen-aligned 2D text shape node, bestie. It's from the SoText2(3IV) manual, and it's literally the queen of putting words on your screen. π
πΈ INHERITS FROM πΈ
It's giving legacy, it's giving bloodline, and the family tree goes like this:
SoBase > SoFieldContainer > SoNode > SoShape > SoText2
β¨ SYNOPSIS β¨
#include <Inventor/nodes/SoText2.h>
π enum Justification
SoText2::LEFTβ Left edges of all strings are alignedSoText2::RIGHTβ Right edges of all strings are alignedSoText2::CENTERβ Centers of all strings are aligned
π¦ Fields from class SoText2:
SoMFString string
SoSFFloat spacing
SoSFEnum justification
π Methods from class SoText2:
SoText2()
static SoType getClassTypeId()
π«Ά Methods from class SoNode:
void setOverride(SbBool state)
SbBool isOverride() const
SoNode * copy(SbBool copyConnections = FALSE) const
virtual SbBool affectsState() const
static SoNode * getByName(const SbName &name)
static int getByName(const SbName &name, SoNodeList &list)
π Methods from class SoFieldContainer:
void setToDefaults()
SbBool hasDefaultValues() const
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
void copyFieldValues(const SoFieldContainer *fc, SbBool
copyConnections = FALSE)
SbBool set(const char *fieldDataString)
void get(SbString &fieldDataString)
virtual int getFields(SoFieldList &resultList) const
virtual SoField * getField(const SbName &fieldName) const
SbBool getFieldName(const SoField *field, SbName &fieldName)
const
SbBool isNotifyEnabled() const
SbBool enableNotify(SbBool flag)
π₯ Methods from class SoBase:
void ref()
void unref() const
void unrefNoDelete() const
void touch()
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
virtual void setName(const SbName &name)
virtual SbName getName() const
π DESCRIPTION π
Okay so boom: this node defines one or more strings of 2D text. That's the whole vibe. The text is always aligned horizontally with the screen and does NOT change size with distance in a perspective projection β like, it refuses to shrink into the distance, it's got main character energy fr fr. The text origin is at (0,0,0) after applying the current transformation. Rotations and scales have no effect on the orientation or size of 2D text β only on the location. So rotate all you want, the letters are not gonna tilt. π
SoText2 uses the current font to determine the typeface and size. The text is always drawn with the diffuse color of the current material; it is not lit, regardless of the lighting model. Not even a little. Furthermore, 2D text can not be textured, and it ignores the current drawing style and complexity. She said no notes, no texture, no drama. π
Because 2D text is screen-aligned, it has some unusual characteristics. For example, the 3D bounding box surrounding a 2D text string depends on the current camera and the current viewport size, since changing the field of view or the mapping onto the window changes the relative size of the text with respect to the rest of the scene. And bestie, this has implications for caching as well, since a render cache in an SoSeparator that contains an SoText2 node depends on the current camera. So if your cache is acting weird β it's not you, it's the camera. π
π FIELDS π
SoMFStringstringβ The text string(s) to display. Each string will appear on its own line. The string(s) can be ascii or UTF-8. Multi-string, multi-line, multi-slay. β¨SoSFFloatspacingβ Defines the distance (in the negative y direction) between the base points of successive strings, measured with respect to the current font height. A value of1indicates single spacing, a value of2indicates double spacing, and so on. Basically the line-height knob. πSoSFEnumjustificationβ Indicates placement and alignment of strings. WithLEFTjustification, the left edge of the first line is at the (transformed) origin, and all left edges are aligned.RIGHTjustification is similar.CENTERjustification places the center of the first string at the (transformed) origin, with the centers of all remaining strings aligned under it. Pick your alignment era. π
π METHODS π
SoText2()β Creates a 2D text node with default settings. Baby's first text node. πΌstatic SoType getClassTypeId()β Returns type identifier for this class. Classic type-id moment, iykyk.
π ACTION BEHAVIOR π
SoGLRenderActionβ Draws text based on the current font, at a location based on the current transformation.SoRayPickActionβ Performs a pick on the text. Text will be picked if the picking ray intersects the bounding box of the strings. The string index and character position are available from theSoTextDetail.SoGetBoundingBoxActionβ Computes the bounding box that encloses the text.
π§ FILE FORMAT/DEFAULTS π§
Text2 {
string ""
spacing 1
justification LEFT
}
β SEE ALSO β
SoFont, SoText3, SoTextDetail
π Not me ending the whole page just to say this, but okay: this wasSoText2(3IV)from theSoText2(3IV)()source/version, and yeah the date field is literally empty, so consider this your no-date, all-vibes timestamp. Periodt. π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms