osgPPU::UnitText Class Reference

Same as UnitInOut but renders text onto the output. More...

Inheritance diagram for osgPPU::UnitText:

osgPPU::UnitInOut osgPPU::Unit

Public Member Functions

 META_Node (osgPPU, UnitText)
 UnitText ()
 Create default ppfx.
 UnitText (const UnitText &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual ~UnitText ()
 Release it and used memory.
virtual void init ()
 Initialze the default postprocessing unit.
void setSize (float size)
 Set size of the characters (relative to viewport.width / 640).
float getSize () const
void setPosition (float x, float y)
 Set text position in 2D coordinates.
osg::Texture * getOrCreateOutputTexture (int mrt=0)
 Text Unit does work as a simple bypass, hence return here always the input.
osgText::Text & getText ()
 Get text assigned with this unit.
const osgText::Text & getText () const
void setText (const std::string &txt)
 Set string drawed by the text.
void setText (osgText::Text *text)
 Set the text pointer used for the rendering.

Protected Member Functions

virtual bool noticeBeginRendering (osg::RenderInfo &, const osg::Drawable *)

Protected Attributes

osg::ref_ptr< osgText::Text > mText
 Text class holder.
float mSize
 Size of the font.

Detailed Description

Same as UnitInOut but renders text onto the output.

The text is displayed in 2D ortho mode. This class is wrapper for the osgText::Text class, so check it for more information about the text support.


Member Function Documentation

virtual bool osgPPU::UnitText::noticeBeginRendering ( osg::RenderInfo &  ,
const osg::Drawable *   
) [protected, virtual]

Here the FBO will be applied, so that Unit can render its output to attached textures. If you overwrite this method in derived class, so you have to take care about FBO handling.

Reimplemented from osgPPU::UnitInOut.


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

Back to Homepage of osgPPU

Copyright (C) 2008 by Art Tevs (LGPL)