BsScriptGUI.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "BsScriptEnginePrerequisites.h"
  3. #include "BsScriptObject.h"
  4. namespace BansheeEngine
  5. {
  6. /** Interop class between C++ & CLR for a global always-accessible GUIWidget. */
  7. class BS_SCR_BE_EXPORT ScriptGUI : public ScriptObject <ScriptGUI>
  8. {
  9. public:
  10. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUI")
  11. /** Creates the globally accessible GUIWidget and makes the system ready to use. */
  12. static void startUp();
  13. /** Updates the main camera the widget renders to, if it changes. Should be called every frame. */
  14. static void update();
  15. /** Destroys the globally accessible GUIWidget and all its GUI elements. */
  16. static void shutDown();
  17. private:
  18. ScriptGUI(MonoObject* managedInstance);
  19. ~ScriptGUI();
  20. static SPtr<GUIWidget> sGUIWidget;
  21. static ScriptGUILayout* sPanel;
  22. /************************************************************************/
  23. /* CLR HOOKS */
  24. /************************************************************************/
  25. static void internal_SetSkin(ScriptGUISkin* skin);
  26. static MonoObject* internal_GetPanel();
  27. };
  28. }