File ManualMovableTextRenderer.h

namespace Ogre

File: MovableText.h

Description: This creates a billboarding object that display a text. Note: This object must have a dedicated scene node since it will rotate it to face the camera (OGRE 2.1)

Author

2003 by cTh see gavocanov@rambler.ru 2006 by barraq see nospam@barraquand.com 2012 to work with newer versions of OGRE by MindCalamity mindcalamity@gmail.com 2015 to work on OGRE 2.1 (but not on older versions anymore) by Jayray jeremy.richert1@gmail.com

class ManualMovableTextRenderer : public ParticleSystemRenderer
#include <ManualMovableTextRenderer.h>

Renderer that is used to create floating text particles, like damage

Public Functions

ManualMovableTextRenderer(const std::string &name, ObjectMemoryManager *memoryManager, SceneManager *sceneManager)
virtual ~ManualMovableTextRenderer()
void setFontName(const std::string &name)

Set font name to use

Parameters
  • name: Id of the font

const std::string &getFontName() const

Get used font name

const std::string &getType() const

Get the type of this renderer

void _updateRenderQueue(RenderQueue *queue, Camera *camera, const Camera *lodCamera, list<Particle *>::type &currentParticles, bool cullIndividually, RenderableArray &outRenderables)

Updates all nodes in the renderer

void _notifyParticleQuota(size_t quota)

Parameters
  • quota: Number of nodes to be allocated

void _notifyDefaultDimensions(Real width, Real height)

Not used

void setRenderQueueGroup(uint8 queueID)

Not used

void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority)

Not used

void setKeepParticlesInLocalSpace(bool keepLocal)

Not used

SortMode _getSortMode() const

Not used

void _setDatablock(HlmsDatablock *datablock)

Not used

void _setMaterialName(const String &matName, const String &resourceGroup)

Not used

void _notifyCurrentCamera(const Camera *cam)

Not used

void _notifyAttached(Node *parent)

Not used

void setRenderQueueSubGroup(uint8 queueID)

Not used

void _destroyVisualData(ParticleVisualData *data)

Not used

Protected Static Attributes

CmdFontName msFontNameCmd

Private Types

typedef std::vector<TextNode> TextNodes
typedef std::deque<TextNode *> TextNodesPtrs
typedef std::map<Particle *, TextNode *> TextNodesMap

Private Functions

void adjustNodeCount()

Adjust particle count to the quota

Private Members

TextNodesMap mBusyNodes
TextNodesPtrs mFreeNodes
TextNodes mNodePool
size_t mQuota
std::string mName
std::string mFontName
int mPrevousParticleCount
class CmdFontName : public ParamCommand

Public Functions

std::string doGet(const void *target) const
void doSet(void *target, const std::string &val)
class ManualMovableTextRendererFactory : public ParticleSystemRendererFactory

Public Functions

ManualMovableTextRendererFactory()
virtual ~ManualMovableTextRendererFactory()
const String &getType() const
ParticleSystemRenderer *createInstance(const String &name)
void destroyInstance(ParticleSystemRenderer *ptr)

Private Members

int mCreatedRenderersCounter
class MovableTextValue : public ParticleVisualData
#include <ManualMovableTextRenderer.h>

Movable text string

Public Functions

MovableTextValue(const std::string &value, SceneNode *attachTo)
const std::string &getValue() const

Get text value for particle

void setNode(TextNode *node)

Set node that is using this movable text value

Parameters
  • node: Pointer to the node

TextNode *getNode()

Node that is using this movable text value

Return

0 if no node present

SceneNode *getNodeToAttachTo()

Get parent node to use for the text node

Private Members

std::string mValue
TextNode *mNode
SceneNode *mSceneNode
class TextNode
#include <ManualMovableTextRenderer.h>

Class that represents created movable text node

Public Functions

TextNode(IdType id, ObjectMemoryManager *memoryManager, SceneManager *sceneManager)
virtual ~TextNode()
void activate(MovableTextValue *value, const std::string &fontName)

Activate text node

Parameters
  • parent: Node to attach text to

  • value: Text value to display

void deactivate()

Deactivate text node this deletes movable text value that was attached to this node

void setPosition(const Vector3 &position)

Set node position

Parameters
  • position: Position

void setColour(const ColourValue &colour)

Set text colour

void setHeight(const float value)

Set text height

Private Members

MovableTextValue *mValue
SceneNode *mSceneNode
MovableText *mView
IdType mId
ObjectMemoryManager *mObjectManager
SceneManager *mSceneManager