Add access functions to IBillboardTextSceneNode (getText, getFont).

Fix IBillboardTextSceneNode::setTextColor which did only set an unused variable. It now maps to setColor instead.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5372 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-03-20 16:35:22 +00:00
parent 51115e14a1
commit 83be80032b
4 changed files with 32 additions and 8 deletions

View File

@ -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.

View File

@ -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

View File

@ -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<f32>& 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

View File

@ -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<f32>& size) _IRR_OVERRIDE_;
@ -138,7 +141,6 @@ namespace scene
private:
core::stringw Text;
video::SColor Color;
gui::IGUIFontBitmap* Font;
core::dimension2d<f32> Size;