91 static void *
operator new(
size_t nSize);
100 static void operator delete(
void *pBlock);
441 void BuildGlyphMesh();
459 float flLineY,
float flLineWidth,
int nCharBase,
const char *pBegin,
const char *pEnd);
489 int HowManyFit(
const char *pText);
494 float MeasureRun(
const char *pText,
int nCount);
505 void ReleaseObjects();
515 void AddRefObjects();
563 unsigned char mReserved108[0x08];
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Collideable()
Construct a collideable with no children.
Sink that the engine formats its diagnostic and failure text into.
Definition dbg.h:33
Drawable()
Construct a visible drawable with no children.
Glyph atlas, either a host font description or a grid of cells inside a material texture.
Definition font.h:59
Indexed triangle mesh with one material.
Definition mesh.h:46
Base of every object the renderer can load, resolve by name, and serialise.
Definition object.h:43
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
Run of text drawn as a quad per glyph.
Definition text.h:57
virtual void SetBillboard(int nBillboard)
Set the billboard mode of this object and of its glyph mesh.
Vector3 CharPosition(int nIndex)
Report where one glyph of the laid-out text sits.
virtual void SetText(const HxStr &text)
Replace the text.
virtual void FindCollisions(const Segment &ray, std::list< Collision > &collisions)
Test a ray against the glyph mesh and append what it strikes to sink.
int CountLines()
Report the number of lines of mText, one more than its newline count.
virtual int DrawShowing()
Draw the glyph mesh.
float mWrapWidth
Width a wrapped line is broken at.
Definition text.h:535
virtual void SetColor(const Color &color)
Set the colour of every glyph.
virtual void SetFont(Font *pFont)
Replace the font.
float GetFontWidth(const char *pText, int nCount)
Report the total advance of the first nCount characters of pText in this text's font.
HxStr mPreWrapText
Text as a caller or a file supplied it, before wrapping.
Definition text.h:550
virtual void Load(Stream &stream)
Read this text run from stream.
Font * GetFont()
Report the font the text is set in.
Definition text.h:353
virtual const HxStr & ClassName() const
Report the class key a .rnd file writes for a text run.
virtual void SetAlign(int nAlign)
Set which point of the block the origin is.
void RebuildText()
Derive mText from mPreWrapText and rebuild the glyph mesh.
virtual ~Text()
Release the glyph mesh and drop the reference on the font.
void GetVerticalBounds(float &flTop, float &flBottom)
Report the vertical extent of the text block about the origin.
virtual void Replace(Object *pFrom, Object *pTo)
Retarget the font when it is the object being replaced.
void SetWrapWidth(float flWrapWidth)
Set the width a wrapped line is broken at.
virtual void SetShowing(int nShowing)
Set whether this object draws at all.
virtual void Copy(const Object *pSource, unsigned nFlags)
Copy the state of pSource into this text run.
virtual void SetHighlight(int nHighlight)
Set whether this object draws with its highlight treatment.
Text(const HxStr &name)
Construct an empty white text run.
virtual void DumpText(Dbg &sink)
Write a description of this text run to sink.
void SetWordWrap(int nWordWrap)
Set whether long lines are broken at word boundaries.
Alignment
Bits of the alignment word.
Definition text.h:66
@ kTextAlignMiddle
Definition text.h:71
@ kTextAlignCenter
Definition text.h:68
@ kTextAlignRight
Definition text.h:69
@ kTextAlignTop
Definition text.h:70
@ kTextAlignBottom
Definition text.h:72
@ kTextAlignLeft
Definition text.h:67
virtual void Save(Stream &stream)
Write this text run to stream at revision 6.
virtual int UpdateWorldXfm(Transformable *pParent, int nForce)
Compose the world transform of this object and then of its glyph mesh.
The rendering engine.
Definition animhelper.h:3
Text * NewTextThroughHook(const HxStr &name)
Build a text run through the creator hook.
Object * CreateRegisteredText(const HxStr &name)
Build a text run for the registered "Text" class.
HxStr g_textClassName
Registered class name of Rnd::Text, the string "Text".
Text * NewText(const HxStr &name)
Allocate and construct a text run.
void RegisterTextClass()
Point Text::sNew at NewText() and register the "Text" class with Rnd::Manager.
Linear colour with four float components.
Definition color.h:10
Line segment a collision query is run along.
Definition collideable.h:22
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:12