IBillboardTextSceneNode.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef IRR_I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED
  5. #define IRR_I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED
  6. #include "IBillboardSceneNode.h"
  7. namespace irr
  8. {
  9. namespace gui
  10. {
  11. class IGUIFont;
  12. }
  13. namespace scene
  14. {
  15. //! A billboard text scene node.
  16. /** Acts like a billboard which displays the currently set text.
  17. Due to the exclusion of RTTI in Irrlicht we have to avoid multiple
  18. inheritance. Hence, changes to the ITextSceneNode interface have
  19. to be copied here manually.
  20. */
  21. class IBillboardTextSceneNode : public IBillboardSceneNode
  22. {
  23. public:
  24. //! Constructor
  25. IBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
  26. const core::vector3df& position = core::vector3df(0,0,0))
  27. : IBillboardSceneNode(parent, mgr, id, position) {}
  28. //! Sets the size of the billboard.
  29. virtual void setSize(const core::dimension2d<f32>& size) = 0;
  30. //! Returns the size of the billboard.
  31. virtual const core::dimension2d<f32>& getSize() const = 0;
  32. //! Set the color of all vertices of the billboard
  33. /** \param overallColor: the color to set */
  34. virtual void setColor(const video::SColor & overallColor) = 0;
  35. //! Set the color of the top and bottom vertices of the billboard
  36. /** \param topColor: the color to set the top vertices
  37. \param bottomColor: the color to set the bottom vertices */
  38. virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0;
  39. //! Gets the color of the top and bottom vertices of the billboard
  40. /** \param topColor: stores the color of the top vertices
  41. \param bottomColor: stores the color of the bottom vertices */
  42. virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0;
  43. //! sets the text string
  44. virtual void setText(const wchar_t* text) = 0;
  45. //! get the text string
  46. virtual const wchar_t* getText() const = 0;
  47. //! sets the color of the text
  48. //! You can use setColor instead which does the same
  49. virtual void setTextColor(video::SColor color)
  50. {
  51. setColor(color);
  52. }
  53. //! Get the font used to draw the text
  54. virtual gui::IGUIFont* getFont() const = 0;
  55. };
  56. } // end namespace scene
  57. } // end namespace irr
  58. #endif