Add access functions to ITextSceneNode (getText, getTextColor, getFont).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5371 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-03-20 12:58:01 +00:00
parent d6d1831589
commit 51115e14a1
4 changed files with 42 additions and 0 deletions

View File

@ -1,6 +1,7 @@
--------------------------
Changes in 1.9 (not yet released)
- Add access functions to ITextSceneNode (getText, getTextColor, getFont).
- Try harder to move Window to custom WindowPosition set in SIrrlichtCreationParameters on X11. Thx@ Hernan Ezequiel Di Giorgi for the patch (#304).
- Fix bug in virtual filessystem which prevented createFileList from working. Thx @Cube for reporting a problem.
- ITriangleSelector now can also return meshbuffer collision information.

View File

@ -9,6 +9,12 @@
namespace irr
{
namespace gui
{
class IGUIFont;
}
namespace scene
{
@ -25,8 +31,17 @@ public:
//! sets the text string
virtual void setText(const wchar_t* text) = 0;
//! get the text string
virtual const wchar_t* getText() const = 0;
//! sets the color of the text
virtual void setTextColor(video::SColor color) = 0;
//! get the color of the text
virtual video::SColor getTextColor() const = 0;
//! Get the font used to draw the text
virtual gui::IGUIFont* getFont() const = 0;
};
} // end namespace scene

View File

@ -77,6 +77,11 @@ void CTextSceneNode::setText(const wchar_t* text)
Text = text;
}
//! get the text string
const wchar_t* CTextSceneNode::getText() const
{
return Text.c_str();
}
//! sets the color of the text
void CTextSceneNode::setTextColor(video::SColor color)
@ -84,6 +89,18 @@ void CTextSceneNode::setTextColor(video::SColor color)
Color = color;
}
//! get the color of the text
video::SColor CTextSceneNode::getTextColor() const
{
return Color;
}
//! Get the font used to draw the text
gui::IGUIFont* CTextSceneNode::getFont() const
{
return Font;
}
//!--------------------------------- CBillboardTextSceneNode ----------------------------------------------

View File

@ -41,9 +41,18 @@ namespace scene
//! sets the text string
virtual void setText(const wchar_t* text) _IRR_OVERRIDE_;
//! get the text string
virtual const wchar_t* getText() const _IRR_OVERRIDE_;
//! sets the color of the text
virtual void setTextColor(video::SColor color) _IRR_OVERRIDE_;
//! get the color of the text
virtual video::SColor getTextColor() const _IRR_OVERRIDE_;
//! Get the font used to draw the text
virtual gui::IGUIFont* getFont() const _IRR_OVERRIDE_;
//! Returns type of the scene node
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_TEXT; }