CGUIInOutFader.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 __C_GUI_IN_OUT_FADER_H_INCLUDED__
  5. #define __C_GUI_IN_OUT_FADER_H_INCLUDED__
  6. #include "IrrCompileConfig.h"
  7. #ifdef _IRR_COMPILE_WITH_GUI_
  8. #include "IGUIInOutFader.h"
  9. namespace irr
  10. {
  11. namespace gui
  12. {
  13. class CGUIInOutFader : public IGUIInOutFader
  14. {
  15. public:
  16. //! constructor
  17. CGUIInOutFader(IGUIEnvironment* environment, IGUIElement* parent,
  18. s32 id, core::rect<s32> rectangle);
  19. //! draws the element and its children
  20. virtual void draw();
  21. //! Gets the color to fade out to or to fade in from.
  22. virtual video::SColor getColor() const;
  23. //! Sets the color to fade out to or to fade in from.
  24. virtual void setColor(video::SColor color );
  25. virtual void setColor(video::SColor source, video::SColor dest);
  26. //! Starts the fade in process.
  27. virtual void fadeIn(u32 time);
  28. //! Starts the fade out process.
  29. virtual void fadeOut(u32 time);
  30. //! Returns if the fade in or out process is done.
  31. virtual bool isReady() const;
  32. //! Writes attributes of the element.
  33. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
  34. //! Reads attributes of the element
  35. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
  36. private:
  37. enum EFadeAction
  38. {
  39. EFA_NOTHING = 0,
  40. EFA_FADE_IN,
  41. EFA_FADE_OUT
  42. };
  43. u32 StartTime;
  44. u32 EndTime;
  45. EFadeAction Action;
  46. video::SColor Color[2];
  47. video::SColor FullColor;
  48. video::SColor TransColor;
  49. };
  50. } // end namespace gui
  51. } // end namespace irr
  52. #endif // _IRR_COMPILE_WITH_GUI_
  53. #endif // __C_GUI_IN_OUT_FADER_H_INCLUDED__