62 void *
operator new(
size_t nSize) {
71 void operator delete(
void *pBlock) {
384 BuildLine(
int nFirstChar,
const char *pszStart,
const char *pszEnd,
float fLine,
float fWidth);
474 std::unique_ptr<RndMesh> mMesh;
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Text output stream.
Definition prnstream.h:16
virtual void Collide(const Segment &segment, std::list< Collision > &collisions)
Test a segment against the collideable and add what it strikes to a list.
RndCollideable()
Construct a collideable without children.
Definition rndcollideable.h:34
RndDrawable()
Construct a showing drawable without a highlight or children.
Definition rnddrawable.h:23
Bitmap font, a grid of character cells in the texture of a material's first stage.
Definition rndfont.h:20
RndObject(const char *pszName)
Construct an object and register it under a name.
void ListDrawObjects(std::list< RndObject * > &objects) override
Add the material of the mesh to a list.
void Save(BinStream &stream) override
Write the text and its bases.
virtual void SetColor(const Color &color)
Set the colour of every character.
int UpdateWorldXfm(RndTransformable *pParent, int bForce) override
Update the world transform of the text, then of its mesh from the text's.
void Copy(const RndObject *pSource, int nFlags) override
Copy another text and its bases, then build the mesh again.
virtual void SetText(const char *pszText)
Set the text.
void ListDrawables(std::list< RndDrawable * > &drawables) override
Add the text unless its mesh is outside the view of the current camera, then the children.
const char * MeasureLine(const char *pszLine, float &fWidth)
Measure the line of mText that starts at a character, with the spacing.
void SetShowing(int nShowing) override
Show or hide the text, building the mesh when it starts showing and deleting it when it stops.
void SetWrapWidth(float fWrapWidth)
Set the width lines wrap at.
static const char * sClassName
The class name a .rnd file writes, Text.
Definition rndtext.h:416
void SetDepthTest(int nDepthTest)
Turn the depth test on or off.
void WrapText(const char *pszText, String &wrapped)
Break text into lines no wider than mWrapWidth, at the last space where there is one.
const String & GetPreWrapText() const
Definition rndtext.h:436
~RndText() override
Drop the reference on the font and delete the mesh.
void ReleaseRefs()
Drop the reference on the font and delete the mesh.
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace the font when it is the object being replaced.
int GetAlign() const
Definition rndtext.h:426
RndFont * GetFont() const
Definition rndtext.h:431
RndText(const char *pszName)
Construct white, empty text aligned to the top left, without a font, wrapping at 100.
int NumLines()
Count the lines of mText.
static RndObject * New(const char *pszName)
Create text.
Definition rndtext.h:406
void SyncDepthTest()
Give the mesh the depth test mDepthTest selects.
void BuildLine(int nFirstChar, const char *pszStart, const char *pszEnd, float fLine, float fWidth)
Fill the quads of one line of the mesh.
const char * ClassName() const override
Report the class name.
Definition rndtext.h:234
float GetWrapWidth() const
Definition rndtext.h:441
void SetHighlight(int nHighlight) override
Set the highlight of the text and of its mesh.
void SetWordWrap(int nWordWrap)
Turn word wrap on or off.
Vector3 CharPosition(int nIndex)
Report the position of a character of mPreWrapText in the text's space.
void Collide(const Segment &segment, std::list< Collision > &collisions) override
Add each face of the mesh the segment strikes, as strikes of the text, then what the children strike,...
float MeasureWidth(const char *pszText, int nCount)
Measure the advance of a run of characters, without the spacing.
static int sRev
The format version Save() writes and Load() accepts.
Definition rndtext.h:423
virtual void SetAlign(int nAlign)
Set the alignment.
void BuildMesh()
Build a mesh of one quad per character of mText, in the font's material.
void DumpText(PrnStream &stream) override
Write a description of the text and its bases.
void SyncText()
Copy mPreWrapText to mText with each tab as three spaces, limit it to 800 characters,...
void SetBillboard(int nBillboard) override
Set the billboard mode of the text and of its mesh.
void UpdateCursors()
Give the text again to every cursor that refers to it.
Align
The bits of mAlign, one vertical and one horizontal.
Definition rndtext.h:30
@ kAlignBottom
Definition rndtext.h:36
@ kAlignMiddle
Definition rndtext.h:35
@ kAlignRight
Definition rndtext.h:33
@ kAlignCenter
Definition rndtext.h:32
@ kAlignLeft
Definition rndtext.h:31
@ kAlignTop
Definition rndtext.h:34
void AcquireRefs()
Take a reference on the font and build the text again.
int DrawShowing() override
Draw the mesh, or the text with the renderer's line font at the local position when there is no mesh.
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it, then build the mesh.
virtual void SetFont(RndFont *pFont)
Set the font.
Growable text buffer that is also a PrnStream.
Definition string.h:19
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
PrnStream & operator<<(PrnStream &stream, RndText::Align eAlign)
Write the names of an alignment's vertical and horizontal parts.
Linear colour with four float components.
Definition color.h:12
Two points that fix a line or a segment.
Definition plane.h:39
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14