diff --git a/changes.txt b/changes.txt index c4a2e174..15d53e38 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,8 @@ -------------------------- Changes in 1.9 (not yet released) +- Fix IBillboardTextSceneNode::setTextColor which did nothing in the past. It now maps to setColor instead. +- Add access functions to IBillboardTextSceneNode (getText, getFont). - 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. diff --git a/include/IBillboardTextSceneNode.h b/include/IBillboardTextSceneNode.h index b7f2359f..0526b63f 100644 --- a/include/IBillboardTextSceneNode.h +++ b/include/IBillboardTextSceneNode.h @@ -9,6 +9,12 @@ namespace irr { + +namespace gui +{ + class IGUIFont; +} + namespace scene { @@ -50,8 +56,18 @@ 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; + //! You can use setColor instead which does the same + virtual void setTextColor(video::SColor color) + { + setColor(color); + } + + //! Get the font used to draw the text + virtual gui::IGUIFont* getFont() const = 0; }; } // end namespace scene diff --git a/source/Irrlicht/CTextSceneNode.cpp b/source/Irrlicht/CTextSceneNode.cpp index af7a0722..bc28a2a8 100644 --- a/source/Irrlicht/CTextSceneNode.cpp +++ b/source/Irrlicht/CTextSceneNode.cpp @@ -251,6 +251,11 @@ void CBillboardTextSceneNode::setText(const wchar_t* text) } } +//! get the text string +const wchar_t* CBillboardTextSceneNode::getText() const +{ + return Text.c_str(); +} //! pre render event void CBillboardTextSceneNode::OnAnimate(u32 timeMs) @@ -425,11 +430,10 @@ const core::dimension2d& CBillboardTextSceneNode::getSize() const return Size; } - -//! sets the color of the text -void CBillboardTextSceneNode::setTextColor(video::SColor color) +//! Get the font used to draw the text +gui::IGUIFont* CBillboardTextSceneNode::getFont() const { - Color = color; + return Font; } //! Set the color of all vertices of the billboard diff --git a/source/Irrlicht/CTextSceneNode.h b/source/Irrlicht/CTextSceneNode.h index 1af14730..40954390 100644 --- a/source/Irrlicht/CTextSceneNode.h +++ b/source/Irrlicht/CTextSceneNode.h @@ -92,8 +92,11 @@ namespace scene //! sets the text string virtual void setText(const wchar_t* text) _IRR_OVERRIDE_; - //! sets the color of the text - virtual void setTextColor(video::SColor color) _IRR_OVERRIDE_; + //! get the text string + virtual const wchar_t* getText() const _IRR_OVERRIDE_; + + //! Get the font used to draw the text + virtual gui::IGUIFont* getFont() const _IRR_OVERRIDE_; //! sets the size of the billboard virtual void setSize(const core::dimension2d& size) _IRR_OVERRIDE_; @@ -138,7 +141,6 @@ namespace scene private: core::stringw Text; - video::SColor Color; gui::IGUIFontBitmap* Font; core::dimension2d Size;