1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __C_TEXT_SCENE_NODE_H_INCLUDED__
6
#define __C_TEXT_SCENE_NODE_H_INCLUDED__
8
#include "ITextSceneNode.h"
9
#include "IBillboardTextSceneNode.h"
11
#include "IGUIFontBitmap.h"
12
#include "ISceneCollisionManager.h"
21
class CTextSceneNode : public ITextSceneNode
26
CTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
27
gui::IGUIFont* font, scene::ISceneCollisionManager* coll,
28
const core::vector3df& position = core::vector3df(0,0,0), const wchar_t* text=0,
29
video::SColor color=video::SColor(100,0,0,0));
32
virtual ~CTextSceneNode();
34
virtual void OnRegisterSceneNode();
37
virtual void render();
39
//! returns the axis aligned bounding box of this node
40
virtual const core::aabbox3d<f32>& getBoundingBox() const;
42
//! sets the text string
43
virtual void setText(const wchar_t* text);
45
//! sets the color of the text
46
virtual void setTextColor(video::SColor color);
48
//! Returns type of the scene node
49
virtual ESCENE_NODE_TYPE getType() const { return ESNT_TEXT; }
56
scene::ISceneCollisionManager* Coll;
57
core::aabbox3d<f32> Box;
60
class CBillboardTextSceneNode : public IBillboardTextSceneNode
64
CBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
65
gui::IGUIFont* font,const wchar_t* text,
66
const core::vector3df& position, const core::dimension2d<f32>& size,
67
video::SColor colorTop, video::SColor shade_bottom);
70
virtual ~CBillboardTextSceneNode();
72
//! sets the vertex positions etc
73
virtual void OnAnimate(u32 timeMs);
75
//! registers the node into the transparent pass
76
virtual void OnRegisterSceneNode();
79
virtual void render();
81
//! returns the axis aligned bounding box of this node
82
virtual const core::aabbox3d<f32>& getBoundingBox() const;
84
//! sets the text string
85
virtual void setText(const wchar_t* text);
87
//! sets the color of the text
88
virtual void setTextColor(video::SColor color);
90
//! sets the size of the billboard
91
virtual void setSize(const core::dimension2d<f32>& size);
93
//! gets the size of the billboard
94
virtual const core::dimension2d<f32>& getSize() const;
96
virtual video::SMaterial& getMaterial(u32 i);
98
//! returns amount of materials used by this scene node.
99
virtual u32 getMaterialCount() const;
101
//! Returns type of the scene node
102
virtual ESCENE_NODE_TYPE getType() const { return ESNT_TEXT; }
104
//! Set the color of all vertices of the billboard
105
//! \param overallColor: the color to set
106
virtual void setColor(const video::SColor & overallColor);
108
//! Set the color of the top and bottom vertices of the billboard
109
//! \param topColor: the color to set the top vertices
110
//! \param bottomColor: the color to set the bottom vertices
111
virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor);
113
//! Gets the color of the top and bottom vertices of the billboard
114
//! \param topColor: stores the color of the top vertices
115
//! \param bottomColor: stores the color of the bottom vertices
116
virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const;
122
gui::IGUIFontBitmap* Font;
124
core::dimension2d<f32> Size;
125
core::aabbox3d<f32> BBox;
126
video::SMaterial Material;
128
video::SColor ColorTop;
129
video::SColor ColorBottom;
139
core::array < SSymbolInfo > Symbol;
144
} // end namespace scene
145
} // end namespace irr