CmGUIWidget.h 1016 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmOverlay.h"
  4. #include "CmTextSprite.h"
  5. namespace CamelotEngine
  6. {
  7. class CM_EXPORT GUIWidget : public Overlay
  8. {
  9. public:
  10. virtual ~GUIWidget();
  11. virtual void render(const Camera* camera, DeferredRenderContextPtr& renderContext) const;
  12. protected:
  13. friend class SceneObject;
  14. GUIWidget(const HSceneObject& parent);
  15. GUILabel* addLabel(const String& text, UINT32 fixedWidth = 0, UINT32 fixedHeight = 0, bool wordWrap = false, TextHorzAlign horzAlign = THA_Left, TextVertAlign vertAlign = TVA_Top);
  16. GUILabel* addLabel(const String& text, TextHorzAlign horzAlign = THA_Left, TextVertAlign vertAlign = TVA_Top);
  17. void setSkin(const GUISkin* skin);
  18. const GUISkin* getGUISkin() const;
  19. private:
  20. void updateMeshes() const;
  21. vector<GUIElement*>::type mElements;
  22. mutable vector<HMesh>::type mCachedMeshes;
  23. mutable vector<HMaterial>::type mCachedMaterials;
  24. const GUISkin* mSkin;
  25. static GUISkin DefaultSkin;
  26. };
  27. }