1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGTEXT_FADETEXT
15#define OSGTEXT_FADETEXT 1
17#include <osgText/Text>
22class OSGTEXT_EXPORT FadeText : public osgText::Text
27 FadeText(const Text& text,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
29 META_Object(osgText,FadeText)
32 /** Set the speed that the alpha value changes as the text is occluded or becomes visible.*/
33 void setFadeSpeed(float fadeSpeed) { _fadeSpeed = fadeSpeed; }
35 /** Get the speed that the alpha value changes.*/
36 float getFadeSpeed() const { return _fadeSpeed; }
39 virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
43 virtual ~FadeText() {}
47 struct FadeTextUpdateCallback;
48 friend struct FadeTextUpdateCallback;
50 typedef std::map<osg::View*, osg::Vec4 > ViewBlendColourMap;
52 ViewBlendColourMap& getViewBlendColourMap() { return _viewBlendColourMap; }
53 const ViewBlendColourMap& getViewBlendColourMap() const { return _viewBlendColourMap; }
57 mutable ViewBlendColourMap _viewBlendColourMap;