3es  0.7
tes::Text2D Class Reference

A shape which renders screen space text, optionally positioned in 3D. More...

#include <3estext2d.h>

Inheritance diagram for tes::Text2D:
tes::Shape

Public Member Functions

 Text2D (const char *text, const V3Arg &pos=V3Arg(0, 0, 0))
 
 Text2D (const char *text, uint32_t id, const V3Arg &pos=V3Arg(0, 0, 0))
 
 Text2D (const char *text, uint32_t id, uint16_t category, const V3Arg &pos=V3Arg(0, 0, 0))
 Construct a box object. More...
 
bool inWorldSpace () const
 
Text2DsetInWorldSpace (bool worldSpace)
 
char * text () const
 
uint16_t textLength () const
 
Text2DsetText (const char *text, uint16_t textLength)
 
virtual bool writeCreate (PacketWriter &stream) const override
 Writes the create message to stream. More...
 
Shapeclone () const override
 Deep copy clone. More...
 
- Public Member Functions inherited from tes::Shape
 Shape (uint16_t routingId, uint32_t id=0)
 
 Shape (uint16_t routingId, uint32_t id, uint16_t category)
 Construct a box object. More...
 
uint16_t routingId () const
 
uint32_t id () const
 
ShapesetId (uint32_t id)
 
uint16_t category () const
 
ShapesetCategory (uint16_t category)
 
ShapesetWireframe (bool wire)
 Sets the wireframe flag value for this shape. More...
 
bool isWireframe () const
 Returns true if the wireframe flag is set. More...
 
ShapesetTransparent (bool transparent)
 Sets the transparent flag value for this shape. More...
 
bool isTransparent () const
 Returns true if the transparent flag is set. More...
 
ShapesetTwoSided (bool twoSided)
 Sets the two sided shader flag value for this shape. More...
 
bool isTwoSided () const
 Returns true if the two sided shader flag is set. More...
 
ShapesetFlags (uint16_t flags)
 Set the full set of ObjectFlag values. More...
 
uint16_t flags () const
 Retrieve the full set of ObjectFlag values. More...
 
ShapesetPosition (const V3Arg &pos)
 
Vector3f position () const
 
ShapesetPosX (float p)
 
ShapesetPosY (float p)
 
ShapesetPosZ (float p)
 
ShapesetRotation (const QuaternionArg &rot)
 
Quaternionf rotation () const
 
ShapesetScale (const V3Arg &scale)
 
Vector3f scale () const
 
ShapesetColour (const Colour &colour)
 
Colour colour () const
 
virtual void updateFrom (const Shape &other)
 Update the attributes of this shape to match other. More...
 
virtual int writeData (PacketWriter &stream, unsigned &progressMarker) const
 Called only for complex shapes to write additional creation data. More...
 
bool writeUpdate (PacketWriter &stream) const
 
bool writeDestroy (PacketWriter &stream) const
 
virtual bool isComplex () const
 Is this a complex shape? Complex shapes have writeData() called. More...
 
virtual int enumerateResources (const Resource **resources, int capacity, int fetchOffset=0) const
 Enumerate the resources used by this shape. More...
 

Protected Member Functions

void onClone (Text2D *copy) const
 
- Protected Member Functions inherited from tes::Shape
void onClone (Shape *copy) const
 Called when copy is created from this object to copy appropriate attributes to copy. More...
 
void init (uint32_t id, uint16_t cat=0, uint16_t flags=0)
 

Additional Inherited Members

- Protected Attributes inherited from tes::Shape
uint16_t _routingId
 
CreateMessage _data
 

Detailed Description

A shape which renders screen space text, optionally positioned in 3D.

Positioning is in normalised screen coordinates. Expects UTF-8 encoding.

Constructor & Destructor Documentation

◆ Text2D()

tes::Text2D::Text2D ( const char *  text,
uint32_t  id,
uint16_t  category,
const V3Arg pos = V3Arg(0, 0, 0) 
)
inline

Construct a box object.

Parameters
idThe shape ID, unique among Arrow objects, or zero for a transient shape.
categoryThe category grouping for the shape used for filtering.

References tes::CreateMessage::flags, and tes::Text2DFWorldSpace.

Member Function Documentation

◆ clone()

Shape* tes::Text2D::clone ( ) const
overridevirtual

Deep copy clone.

Returns
A deep copy.

Reimplemented from tes::Shape.

◆ writeCreate()

virtual bool tes::Text2D::writeCreate ( PacketWriter stream) const
overridevirtual

Writes the create message to stream.

Simple shapes will write all data in the create message. More complex shapes may have additional data which is required to create object (e.g., point clouds). In the latter case, only enough data to initialise the object need be written.

Reimplemented from tes::Shape.


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